Trigger dev deploy #1070
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: 'Trigger dev deploy' | |
on: | |
workflow_dispatch: | |
inputs: | |
monorepoGitHash: | |
description: git hash of the monorepo | |
required: true | |
jobs: | |
publish: | |
name: "Prepare deploy to dev" | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Generate app installation access token" | |
uses: navikt/github-app-token-generator@v1 | |
id: generate-token | |
with: | |
private-key: ${{ secrets.PUBLISHING_APP_PRIVATE_KEY }} | |
app-id: ${{ secrets.PUBLISHING_APP_ID }} | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.ref }} | |
fetch-depth: 0 | |
token: ${{ steps.generate-token.outputs.token }} | |
- name: "Git config user email and name" | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "github-actions" | |
- name: "Fetch latest forms and translations from master, ignore merge conflicts due to monorepo reference" | |
run: git merge origin/master || git add MONOREPO | |
- name: "Update MONOREPO reference" | |
run: echo -n ${{ github.event.inputs.monorepoGitHash }} > MONOREPO | |
- name: "Add MONOREPO" | |
run: git add MONOREPO | |
- name: "No unstaged changes should exist, quit otherwise" | |
run: git diff --quiet | |
- name: "Commit changes" | |
run: | | |
git commit -m "[${{ github.ref }}] monorepo ref: ${{ github.event.inputs.monorepoGitHash }}" | |
- name: "Push changes" | |
run: git push |