forked from amputator84/sd_telegram
-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (44 loc) · 1.73 KB
/
build.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: Actions Build Docker Image
run-name: ${{ github.actor }} is building new image 🚀
on: [push]
jobs:
Explore-github-Actions:
runs-on:
group: ubuntu-runners
labels: ubuntu-20.04-16core
steps:
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- name: Install Node.js
run: |
apt install -y nodejs
- name: Check out repository code
uses: actions/checkout@v3
- name: List files in the repository
run: |
ls ${{ github.workspace }}
- run: echo "🍏 This job's status is ${{ job.status }}."
- name: Install Docker
run: |
apt install -y docker
- name: Start Docker service
run: |
dockerd &
sleep 5
docker info
- name: Build Dockerfile
run: |
docker build -t sd_telegram .
- name: Add new variables
run: |
package_name=$(basename ${{ github.repository }})
commit_date=$(git log -1 --format=%cd --date=format:'%Y%m%d%H%M%S')
echo "package_name=$package_name, commit_date=$commit_date"
- name: Upload Docker image to ghcr.io
run: |
package_name=$(basename ${{ github.repository }})
commit_date=$(git log -1 --format=%cd --date=format:'%Y%m%d%H%M%S')
docker login -u ${{ secrets.username }} -p ${{ secrets.password }} ghcr.io
docker tag sd_telegram ghcr.io/${{ secrets.username }}/$package_name:$commit_date
docker tag sd_telegram ghcr.io/${{ secrets.username }}/$package_name:latest
docker push ghcr.io/${{ secrets.username }}/$package_name:$commit_date
docker push ghcr.io/${{ secrets.username }}/$package_name:latest