41 lines
1.1 KiB
YAML
41 lines
1.1 KiB
YAML
# Explicit URLs and commit pins keep action sources predictable on Gitea.
|
|
# yamllint disable rule:line-length
|
|
name: Build and publish Docker image
|
|
|
|
'on':
|
|
push:
|
|
branches: [main]
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: ${{ gitea.workflow }}-${{ gitea.ref }}
|
|
cancel-in-progress: true
|
|
|
|
env:
|
|
IMAGE: gitea.cptckp.com/nurinda/recruitment-hc
|
|
|
|
jobs:
|
|
build:
|
|
if: gitea.ref == 'refs/heads/main'
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 40
|
|
steps:
|
|
- name: Checkout
|
|
uses: https://github.com/actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Log in to Gitea Container Registry
|
|
uses: https://github.com/docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3
|
|
with:
|
|
registry: gitea.cptckp.com
|
|
username: ${{ secrets.REGISTRY_USERNAME }}
|
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
|
|
|
- name: Build and publish latest
|
|
shell: bash
|
|
run: |
|
|
set -euo pipefail
|
|
docker build --tag "$IMAGE:latest" .
|
|
docker push "$IMAGE:latest"
|