forked from amputator84/sd_telegram
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
AleX
committed
Nov 17, 2024
1 parent
cf14baf
commit a918196
Showing
2 changed files
with
43 additions
and
39 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Actions Build Docker Image | ||
run-name: ${{ github.actor }} is building new image 🚀 | ||
on: [push] | ||
|
||
jobs: | ||
Explore-github-Actions: | ||
runs-on: alpine | ||
steps: | ||
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." | ||
- name: Install Node.js | ||
run: | | ||
apk add --no-cache 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: | | ||
apk add --no-cache 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 |