mirror of
https://git.sr.ht/~ashkeel/sourcehut-mirror-bridge
synced 2024-11-23 21:32:20 +00:00
aafd083218
All checks were successful
Build and push Docker image / build-and-publish (push) Successful in 2m15s
41 lines
1.6 KiB
YAML
41 lines
1.6 KiB
YAML
name: Build and push Docker image
|
|
|
|
on:
|
|
push:
|
|
|
|
jobs:
|
|
build-and-publish:
|
|
runs-on: docker
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Build latest
|
|
uses: https://codeberg.org/umglurf/kaniko-action@main
|
|
with:
|
|
cache: true
|
|
cache_repo: ${{ vars.REGISTRY_URL }}/${{ github.repository }}/cache
|
|
credentials: |
|
|
${{ vars.REGISTRY_URL }}=${{ secrets.REGISTRY_USERNAME }}:${{ secrets.REGISTRY_TOKEN }}
|
|
destinations: |
|
|
${{ vars.REGISTRY_URL }}/${{ github.repository }}:latest ${{ vars.REGISTRY_URL }}/${{ github.repository }}:${{ github.sha }}
|
|
push: "true"
|
|
if: github.ref == 'refs/heads/master'
|
|
|
|
- name: Build ref
|
|
uses: https://codeberg.org/umglurf/kaniko-action@main
|
|
with:
|
|
cache: true
|
|
cache_repo: ${{ vars.REGISTRY_URL }}/${{ github.repository }}/cache
|
|
credentials: |
|
|
${{ vars.REGISTRY_URL }}=${{ secrets.REGISTRY_USERNAME }}:${{ secrets.REGISTRY_TOKEN }}
|
|
destinations: |
|
|
${{ vars.REGISTRY_URL }}/${{ github.repository }}:${{ github.ref_name }} ${{ vars.REGISTRY_URL }}/${{ github.repository }}:${{ github.sha }}
|
|
push: "true"
|
|
if: github.ref != 'refs/heads/master'
|
|
|
|
- name: Deploy via shipit
|
|
uses: https://github.com/Hamcha/shipit@main
|
|
with:
|
|
provider: ${{ secrets.SHIPIT_PROVIDER }}
|
|
changes: '[{"templater":"yaml","file":"docker-compose.yml","changes":{"services.srht-mirror.image":"git.fromouter.space/hamcha/sourcehut-mirror-bridge:${{ github.sha }}"}}]'
|
|
branch: master
|