soaska is building new image 🚀 #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |