Honor USE_DEFENDER_SIGNER env var to route this run via Defender #58
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: Actions Image | |
| on: | |
| push: | |
| branches: | |
| - automation | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| packages: write | |
| jobs: | |
| build-and-push: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up SSH agent for @automaton/client deploy key | |
| uses: webfactory/ssh-agent@v0.9.0 | |
| with: | |
| ssh-private-key: ${{ secrets.TALOS_DEPLOY_KEY }} | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Prepare image metadata | |
| id: prep | |
| run: | | |
| IMAGE_NAME="ghcr.io/${{ github.repository_owner }}/arm-actions" | |
| IMAGE_NAME="$(echo "${IMAGE_NAME}" | tr '[:upper:]' '[:lower:]')" | |
| echo "image_name=${IMAGE_NAME}" >> "${GITHUB_OUTPUT}" | |
| - name: Build and push image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| file: ./dockerfile-actions | |
| push: true | |
| ssh: default | |
| tags: | | |
| ${{ steps.prep.outputs.image_name }}:latest | |
| ${{ steps.prep.outputs.image_name }}:${{ github.sha }} | |
| - name: Trigger Railway redeploy | |
| if: success() && env.RAILWAY_TOKEN != '' | |
| env: | |
| RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN }} | |
| RAILWAY_SERVICE_ID: ${{ secrets.RAILWAY_SERVICE_ID }} | |
| run: | | |
| npm i -g @railway/cli | |
| railway redeploy --service "$RAILWAY_SERVICE_ID" --yes |