Skip to content

Commit

Permalink
Trying github actions.
Browse files Browse the repository at this point in the history
  • Loading branch information
AleX committed Nov 17, 2024
1 parent cf14baf commit a918196
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 39 deletions.
39 changes: 0 additions & 39 deletions .gitea/workflows/build.yaml

This file was deleted.

43 changes: 43 additions & 0 deletions .github/workflows/build.yaml
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

0 comments on commit a918196

Please sign in to comment.