a1d63e148e
- Add Gitea Actions workflow (.gitea/workflows/ci.yaml) - Update K8s deployment image registry to oci.unbound.se
43 lines
1.2 KiB
YAML
43 lines
1.2 KiB
YAML
name: geo-service
|
|
|
|
on:
|
|
push:
|
|
branches: [master]
|
|
pull_request:
|
|
branches: [master]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
BUILDTOOLS_CONTENT: ${{ secrets.BUILDTOOLS_CONTENT }}
|
|
GITEA_REPOSITORY: ${{ gitea.repository }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: buildtool/setup-buildtools-action@v1
|
|
- name: Test registry connectivity
|
|
run: curl -I https://oci.unbound.se/v2/
|
|
- name: Test docker login
|
|
run: echo "${{ secrets.REGISTRY_TOKEN }}" | docker login oci.unbound.se -u buildtools --password-stdin
|
|
- name: Show config
|
|
run: unset GITHUB_REPOSITORY_OWNER GITEA_TOKEN && env && build --config
|
|
- name: Build and push
|
|
run: |
|
|
unset GITHUB_REPOSITORY_OWNER GITEA_TOKEN
|
|
echo "GITEA_TOKEN after unset: '${GITEA_TOKEN:-unset}'"
|
|
build --verbose && push --verbose
|
|
|
|
deploy-prod:
|
|
needs: build
|
|
if: gitea.ref == 'refs/heads/master'
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
BUILDTOOLS_CONTENT: ${{ secrets.BUILDTOOLS_CONTENT }}
|
|
GITEA_REPOSITORY: ${{ gitea.repository }}
|
|
environment: prod
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: buildtool/setup-buildtools-action@v1
|
|
- name: Deploy
|
|
run: deploy prod
|