Initial commit
Some checks failed
Build and Publish Docker Images / build (server.Dockerfile, ${{ vars.IMAGE_NAME_SERVER }}) (push) Has been cancelled
Build and Publish Docker Images / build (server.Dockerfile, ${{ vars.IMAGE_NAME_WORKER }}) (push) Has been cancelled
Build and Publish Docker Images / build (worker.Dockerfile, ${{ vars.IMAGE_NAME_SERVER }}) (push) Has been cancelled
Build and Publish Docker Images / build (worker.Dockerfile, ${{ vars.IMAGE_NAME_WORKER }}) (push) Has been cancelled
Build and Publish Docker Images / setup (push) Has been cancelled
Some checks failed
Build and Publish Docker Images / build (server.Dockerfile, ${{ vars.IMAGE_NAME_SERVER }}) (push) Has been cancelled
Build and Publish Docker Images / build (server.Dockerfile, ${{ vars.IMAGE_NAME_WORKER }}) (push) Has been cancelled
Build and Publish Docker Images / build (worker.Dockerfile, ${{ vars.IMAGE_NAME_SERVER }}) (push) Has been cancelled
Build and Publish Docker Images / build (worker.Dockerfile, ${{ vars.IMAGE_NAME_WORKER }}) (push) Has been cancelled
Build and Publish Docker Images / setup (push) Has been cancelled
This commit is contained in:
commit
68f6e85c78
17 changed files with 1286 additions and 0 deletions
54
.forgejo/workflows/build-and-publish.yml
Normal file
54
.forgejo/workflows/build-and-publish.yml
Normal file
|
@ -0,0 +1,54 @@
|
|||
name: Build and Publish Docker Images
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
setup:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
branch: ${{ steps.get-git-context.outputs.branch }}
|
||||
commit: ${{ steps.get-git-context.outputs.commit }}
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Get Git Context
|
||||
id: get-git-context
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
script: |
|
||||
const branch = github.ref.split('/').pop();
|
||||
const commit = github.sha;
|
||||
core.setOutput('branch', branch);
|
||||
core.setOutput('commit', commit);
|
||||
|
||||
build:
|
||||
needs: setup
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
dockerfile: ["worker.Dockerfile", "server.Dockerfile"]
|
||||
image-name: ["${{ vars.IMAGE_NAME_WORKER }}", "${{ vars.IMAGE_NAME_SERVER }}"]
|
||||
steps:
|
||||
- name: Build and Push Image
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
file: ${{ matrix.dockerfile }}
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
tags: |
|
||||
git.brmartin.co.uk/${{ matrix.image-name }}:${{ needs.setup.outputs.branch }}
|
||||
git.brmartin.co.uk/${{ matrix.image-name }}:${{ needs.setup.outputs.commit }}
|
Loading…
Add table
Add a link
Reference in a new issue