deploy.yaml added
This commit is contained in:
parent
ec469f7e2b
commit
c634066d69
1 changed files with 55 additions and 0 deletions
55
.forgejo/workflows/deploy.yaml
Normal file
55
.forgejo/workflows/deploy.yaml
Normal file
|
@ -0,0 +1,55 @@
|
||||||
|
name: Docker Build and Push
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
paths:
|
||||||
|
- 'Dockerfile'
|
||||||
|
- '**/*.{ts,html,scss,json}'
|
||||||
|
- 'package*.json'
|
||||||
|
- 'angular.json'
|
||||||
|
- 'nginx.conf'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-push:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
packages: write
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout Repository
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
id: buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Docker Login to Forgejo Registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: ${{ forgejo.instance_url }}/packages/${{ github.repository_owner }}/${{ github.repository }}
|
||||||
|
username: ${{ github.repository_owner }}
|
||||||
|
password: ${{ secrets.FORGEJO_PACKAGE_REGISTRY_TOKEN }}
|
||||||
|
|
||||||
|
- name: Build and Push Docker Image
|
||||||
|
id: docker_build_push
|
||||||
|
uses: docker/build-push-action@v5
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: Dockerfile
|
||||||
|
push: true
|
||||||
|
tags: ${{ forgejo.instance_url }}/packages/${{ github.repository_owner }}/${{ github.repository }}:${{ github.sha }}
|
||||||
|
labels: |
|
||||||
|
org.opencontainers.image.title=${{ github.repository }}
|
||||||
|
org.opencontainers.image.version=${{ github.sha }}
|
||||||
|
org.opencontainers.image.created=${{ github.event.inputs.timestamp }}
|
||||||
|
org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}
|
||||||
|
org.opencontainers.image.revision=${{ github.sha }}
|
||||||
|
|
||||||
|
- name: Echo Image Details
|
||||||
|
run: |
|
||||||
|
echo "Docker image built and pushed to:"
|
||||||
|
echo "${{ steps.docker_build_push.outputs.digest }}"
|
||||||
|
echo "${{ steps.docker_build_push.outputs.tags }}"
|
Loading…
Reference in a new issue