ci: Build secrets server on PRs, publish on releases. #1
@@ -1,6 +1,11 @@
|
|||||||
name: build-secretsserver
|
name: build-secretsserver
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
# Only run on release tags.
|
||||||
|
tags: ["v*"]
|
||||||
pull_request:
|
pull_request:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@@ -9,19 +14,29 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v5
|
||||||
|
|
||||||
|
# Unfortunately gotta use a PAT,
|
||||||
|
# workflow tokens can't access the registry yet.
|
||||||
|
- name: Log in to the registry
|
||||||
|
if: gitea.event_name != 'pull_request'
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: git.handmadecities.com
|
||||||
|
username: ${{ vars.REGISTRY_USER }}
|
||||||
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||||
|
|
||||||
- name: Compute tags
|
- name: Compute tags
|
||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@v5
|
uses: docker/metadata-action@v5
|
||||||
with:
|
with:
|
||||||
images: git.handmadecities.com/${{ gitea.repository }}
|
images: git.handmadecities.com/${{ gitea.repository }}/secretsserver
|
||||||
tags: |
|
tags: |
|
||||||
type=semver,pattern={{version}}
|
type=semver,pattern={{version}}
|
||||||
type=sha
|
|
||||||
|
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
file: docker/secretsserver/Dockerfile
|
file: docker/secretsserver/Dockerfile
|
||||||
context: .
|
context: .
|
||||||
push: ${{ gitea.event_name != 'pull_request' }}
|
# Only push on releases.
|
||||||
|
push: ${{ gitea.ref_type == 'tag' }}
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
Reference in new issue
Block a user