forked from amputator84/sd_telegram
-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (42 loc) · 1.74 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
name: Actions Build Docker Image
run-name: ${{ github.actor }} is building new image 🚀
on: [push]
jobs:
Explore-github-Actions:
runs-on: ubuntu-latest
steps:
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- name: Install Node.js
run: |
sudo apt install -y nodejs
- name: Check out repository code
uses: actions/checkout@v3
- name: List files in the repository
run: |
sudo ls ${{ github.workspace }}
- run: echo "🍏 This job's status is ${{ job.status }}."
- name: Install Docker
run: |
sudo apt install -y docker
- name: Start Docker service
run: |
sudo dockerd &
sleep 5
sudo docker info
- name: Build Dockerfile
run: |
sudo 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')
sudo docker login -u ${{ secrets.username }} -p ${{ secrets.password }} ghcr.io
sudo docker tag sd_telegram ghcr.io/${{ secrets.username }}/$package_name:$commit_date
sudo docker tag sd_telegram ghcr.io/${{ secrets.username }}/$package_name:latest
# sudo docker push ghcr.io/${{ secrets.username }}/$package_name:$commit_date
sudo docker push ghcr.io/${{ secrets.username }}/$package_name:beta