containerize & enhance filtering
All checks were successful
Build & Push Docker Image / build-and-publish (push) Successful in 14s
All checks were successful
Build & Push Docker Image / build-and-publish (push) Successful in 14s
This commit is contained in:
32
.gitea/workflows/build-image.yml
Normal file
32
.gitea/workflows/build-image.yml
Normal file
@@ -0,0 +1,32 @@
|
||||
name: Build & Push Docker Image
|
||||
|
||||
on: push
|
||||
|
||||
jobs:
|
||||
build-and-publish:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Output Repository Information
|
||||
run: |
|
||||
echo This workflow will build and push a Docker image to:
|
||||
echo ${{ vars.REPO_ADDRESS }}/${{ vars.REPO_USER }}/${{ vars.REPO_NAME }}:latest
|
||||
echo https://${{ vars.REPO_ADDRESS }}/${{ vars.REPO_USER }}/${{ vars.REPO_NAME }}
|
||||
|
||||
- name: Build Docker Image
|
||||
run: |
|
||||
docker build -t ${{ vars.REPO_ADDRESS }}/${{ vars.REPO_USER }}/${{ vars.REPO_NAME }}:latest --output type=docker --platform linux/amd64 .
|
||||
|
||||
- name: Log in to Container Repo
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ vars.REPO_USER }}
|
||||
registry: ${{ vars.REPO_ADDRESS }}
|
||||
password: ${{ secrets.REPO_TOKEN }}
|
||||
|
||||
- name: Push Docker Image
|
||||
run: |
|
||||
echo "Pushing Docker image with tag: latest to ${{ vars.REPO_ADDRESS }}"
|
||||
docker push ${{ vars.REPO_ADDRESS }}/${{ vars.REPO_USER }}/${{ vars.REPO_NAME }}:latest
|
||||
docker rmi ${{ vars.REPO_ADDRESS }}/${{ vars.REPO_USER }}/${{ vars.REPO_NAME }}:latest || true
|
||||
Reference in New Issue
Block a user