Added Workflow to upload new docker image on push
Some checks failed
Publish to Package Regsitry / deploy (push) Failing after 2m21s
Some checks failed
Publish to Package Regsitry / deploy (push) Failing after 2m21s
This commit is contained in:
44
.gitea/workflows/publish-registry.yml
Normal file
44
.gitea/workflows/publish-registry.yml
Normal file
@ -0,0 +1,44 @@
|
||||
name: Publish to Package Regsitry
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
env:
|
||||
REGISTRY_URL: https://gitea.jono-rams.work
|
||||
REGISTRY_TOKEN: ${{ secrets.GLOBAL_PACKAGE_TOKEN }}
|
||||
REGISTRY_USER: ${{ vars.GLOBAL_ACCOUNT_EMAIL }}
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Login to Gitea Package Regsitry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ env.REGISTRY_URL }}
|
||||
username: ${{ env.REGISTRY_USER }}
|
||||
password: ${{ env.REGISTRY_TOKEN }}
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Build and Push Docker Image
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
push: true
|
||||
tags: |
|
||||
${{ env.REGISTRY_URL }}/${{ secrets.GITEA_REPOSITORY_OWNER }}/${{ secrets.GITEA_REPOSITORY_NAME }}:latest
|
||||
${{ env.REGISTRY_URL }}/${{ secrets.GITEA_REPOSITORY_OWNER }}/${{ secrets.GITEA_REPOSITORY_NAME }}:${{ github.sha }}
|
||||
|
||||
- name: Logout from Gitea Package Regsitry
|
||||
if: always()
|
||||
run: docker logout ${env.REGISTRY_URL}
|
||||
|
Reference in New Issue
Block a user