feat: add azure psql backups #242
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build & Push status image | |
| on: | |
| schedule: | |
| - cron: "0 0 1 * *" | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - status/** | |
| - .github/workflows/build-status.yaml | |
| workflow_dispatch: | |
| permissions: | |
| id-token: write | |
| packages: write | |
| contents: read | |
| jobs: | |
| build-and-push: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v6 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v4 | |
| - name: Login to GHCR | |
| uses: docker/login-action@v4 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.repository_owner }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Generate image metadata | |
| id: meta | |
| uses: docker/metadata-action@v6 | |
| with: | |
| images: ghcr.io/tietokilta/tik-status | |
| tags: | | |
| type=semver,pattern={{version}},enable=${{ github.ref_type == 'tag' }} | |
| type=semver,pattern={{major}}.{{minor}},enable=${{ github.ref_type == 'tag' }} | |
| type=raw,value=sha-${{github.sha}} | |
| type=raw,value=latest,enable={{is_default_branch}} | |
| - name: Build and push image | |
| uses: docker/build-push-action@v7 | |
| with: | |
| context: ./status | |
| platforms: linux/amd64 | |
| push: ${{ github.ref == 'refs/heads/main' }} | |
| tags: ${{ steps.meta.outputs.tags }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| deploy: | |
| # only run on published releases, enable this when we release | |
| #if: github.event_name == 'release' && github.event.action == 'published' | |
| if: github.ref == 'refs/heads/main' | |
| needs: build-and-push | |
| name: Deploy to Azure | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Login via Azure CLI | |
| uses: azure/login@v3 | |
| with: | |
| client-id: ${{secrets.AZURE_CLIENT_ID}} | |
| subscription-id: ${{secrets.AZURE_SUBSCRIPTION_ID}} | |
| tenant-id: ${{secrets.AZURE_TENANT_ID}} | |
| - uses: azure/webapps-deploy@v3 | |
| with: | |
| app-name: tik-status-prod # TODO: if we ever setup more envs than prod, make this variable customizable | |
| images: ghcr.io/tietokilta/tik-status:sha-${{ github.sha }} |