Skip to content

Workflow file for this run

name: Release docker image
on:
release:
types: [created]
jobs:
release:
runs-on: ubuntu-latest
permissions:
packages: write # required to publish docker image
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta-builder
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/georiviere-public-builder
- name: Build and push Docker image builder
uses: docker/build-push-action@v3
with:
context: .
file: ./.docker/Dockerfile
push: true
tags: ${{ steps.meta-builder.outputs.tags }}
labels: ${{ steps.meta-builder.outputs.labels }}
target: builder
attach_install_release:
runs-on: ubuntu-latest
needs: [ release ]
permissions:
contents: write # required to attach zip to release
if: ${{ github.event_name == 'release' && github.event.action == 'created' }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Prepare install.zip
run: |
cd install
mkdir georiviere-public
cp -r * ./georiviere-public 2>/dev/null || :
cp .env.dist ./georiviere-public
zip -r ../install.zip georiviere-public/
- name: Attach zip archive as release binary
uses: skx/github-action-publish-binaries@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: 'install.zip'