fix: Change new pages file structure #60
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: 'Deploy' | |
on: | |
push: | |
branches: | |
- dev | |
tags: | |
- '*' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: 'Checkout code' | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: 'Set image tag' | |
id: tag | |
run: | | |
IMAGE_TAG="0.0.0" | |
if [[ "${{ github.ref }}" == "refs/tags/"* ]]; then | |
REF=${{ github.ref }}; | |
TAG_FULL=${REF#refs/*/}; | |
IMAGE_TAG=${TAG_FULL//\//_}; | |
fi | |
echo "IMAGE_TAG=${IMAGE_TAG}" >> $GITHUB_ENV | |
echo "image_tag=${IMAGE_TAG}" >> $GITHUB_OUTPUT | |
- name: 'Set up QEMU' | |
uses: docker/setup-qemu-action@v2 | |
- name: 'Set up Docker Buildx' | |
uses: docker/setup-buildx-action@v2 | |
- name: 'Login to GHCR' | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.CR_PAT }} | |
- name: 'Build and push' | |
id: docker_build | |
uses: docker/build-push-action@v4 | |
with: | |
push: true | |
tags: ghcr.io/flipperdevices/flpr.app:${{steps.tag.outputs.image_tag}} | |
- name: 'Image digest' | |
run: | | |
echo ${{ steps.docker_build.outputs.digest }} | |
- name: 'Trigger k8s to use new image' | |
uses: peter-evans/repository-dispatch@v2 | |
with: | |
repository: ${{ secrets.INFRASTRUCTURE_REPO }} | |
token: ${{ secrets.K8S_GITHUB_PAT }} | |
event-type: flpr-app-deploy | |
client-payload: '{"image_tag": "${{steps.tag.outputs.image_tag}}"}' |