Skip to content

chore: 📦️ migrate yarn to pnpm #44

chore: 📦️ migrate yarn to pnpm

chore: 📦️ migrate yarn to pnpm #44

name: bundestag.io-admin/ Build and Push Docker Image
on:
workflow_dispatch:
push:
paths:
- 'bundestag.io/admin/**'
branches:
- 'master'
tags:
- 'bundestag.io-admin@v*'
pull_request:
paths:
- 'bundestag.io/admin/**'
branches:
- 'master'
jobs:
push:
runs-on: ubuntu-latest
environment: docker
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: democracy/bundestag.io-admin
tags: |
type=ref,event=branch,enable=${{ github.ref == format('refs/heads/{0}', 'master') || github.ref == format('refs/heads/{0}', 'alpha') || github.ref == format('refs/heads/{0}', 'internal') }}
type=ref,event=pr
type=match,asref=foo,pattern=crawler@v(\d+.\d+.\d+)(-alpha.\d+)?,group=1
type=semver,pattern={{version}},use=foo
type=sha,enable=${{ github.event_name == 'workflow_dispatch' }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
if: github.event_name != 'pull_request'
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
context: bundestag.io/admin
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}