Deploy Marianobe Site (9021c055) #34
This file contains 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: Marianobe Site deploy | |
run-name: Deploy Marianobe Site (${{ github.event.client_payload.sha || inputs.sha }}) | |
permissions: | |
contents: write | |
env: | |
REPO: "r2-registry-production.mbenedettini-cloudflare.workers.dev/marianobe-site" | |
on: | |
repository_dispatch: | |
types: [deploy-marianobe-site] | |
workflow_dispatch: | |
inputs: | |
sha: | |
required: true | |
description: Git SHA | |
jobs: | |
deploy-marianobe-site: | |
name: "Deploy Marianobe Site" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: main | |
token: ${{ secrets.FLUX_BOT_TOKEN }} | |
- name: Define variables | |
id: define | |
run: | | |
export sha_short="$(git rev-parse --short ${{ github.event.client_payload.sha }})" | |
echo "docker_image_tag=${sha_short}" >> $GITHUB_OUTPUT | |
echo "file_to_change=apps/staging/marianobe-site/deployment.yaml" >> $GITHUB_OUTPUT | |
- name: Change image tag | |
env: | |
IMAGE_TAG: ${{ steps.define.outputs.docker_image_tag }} | |
run: yq eval '.spec.template.spec.containers[0].image=env(REPO) + ":${{ github.event.client_payload.sha }}"' -i ${{ steps.define.outputs.file_to_change }} | |
- name: Commit and Push | |
run: | | |
git config user.name "flux-infra[bot]" | |
git config user.email "flux-infra[bot]@users.noreply.github.com" | |
git add ${{ steps.define.outputs.file_to_change }} | |
git commit -m "[Deploy] Marianobe Site [${{github.event.client_payload.sha}}]" | |
git push |