Skip to content

Merge pull request #392 from frontendnetwork/dependabot/npm_and_yarn/… #42

Merge pull request #392 from frontendnetwork/dependabot/npm_and_yarn/…

Merge pull request #392 from frontendnetwork/dependabot/npm_and_yarn/… #42

Workflow file for this run

# Default GitHub build&push workflow
# Docs: https://docs.github.com/en/actions/publishing-packages/publishing-docker-images#publishing-images-to-github-packages
name: Create and publish a Docker image
on:
push:
branches:
- main
- release
- staging
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build-and-push-prod:
if: github.ref != 'refs/heads/staging'
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
environment:
name: Production
url: https://vegancheck.me
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Log in to the Container registry
uses: docker/login-action@a9794064588be971151ec5e7144cb535bcb56e36
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@35e9aff4f5d665b5aa8a8f2adffaf8a1b5f49cc0
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push Docker image
uses: docker/build-push-action@4fad532b9fdbfb80f436784834374a1c11834153
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-and-push-staging:
if: github.ref == 'refs/heads/staging'
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
environment:
name: Staging
url: https://staging.vegancheck.me
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Log in to the Container registry
uses: docker/login-action@a9794064588be971151ec5e7144cb535bcb56e36
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@35e9aff4f5d665b5aa8a8f2adffaf8a1b5f49cc0
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push Docker image
uses: docker/build-push-action@4fad532b9fdbfb80f436784834374a1c11834153
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}