Add Forgejo CI/CD workflow for Docker build & push
All checks were successful
Build & Push Container Image / build (push) Successful in 15s
All checks were successful
Build & Push Container Image / build (push) Successful in 15s
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
fdd9ba8d56
commit
620547c78c
1 changed files with 28 additions and 0 deletions
28
.forgejo/workflows/build-push.yml
Normal file
28
.forgejo/workflows/build-push.yml
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
name: Build & Push Container Image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
|
||||
env:
|
||||
REGISTRY: git.faralmail.com
|
||||
IMAGE_PREFIX: faral
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Short SHA
|
||||
run: echo "SHORT_SHA=$(echo $GITHUB_SHA | cut -c1-7)" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Login to Forgejo Registry
|
||||
run: echo "${{ secrets.REGISTRY_TOKEN }}" | docker login $REGISTRY -u ${{ github.repository_owner }} --password-stdin
|
||||
|
||||
- name: Build and push
|
||||
run: |
|
||||
TAG="${REGISTRY}/${IMAGE_PREFIX}/pokerface"
|
||||
docker build -t "${TAG}:${{ github.run_number }}-${SHORT_SHA}" -t "${TAG}:latest" .
|
||||
docker push "${TAG}:${{ github.run_number }}-${SHORT_SHA}"
|
||||
docker push "${TAG}:latest"
|
||||
Loading…
Add table
Add a link
Reference in a new issue