Skip to content

Copy env file to runner container #2

Copy env file to runner container

Copy env file to runner container #2

Workflow file for this run

name: Build Docker image
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
docker:
name: Push to GitHub Container Registry
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- run: |
mv .env.prod .env
- name: Docker meta
id: docker_meta
uses: docker/metadata-action@v4
with:
images: "ghcr.io/${{ github.repository }}"
tags: |
type=sha
type=ref,event=branch
flavor: |
latest=true
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to ghcr.io
uses: docker/login-action@v2
if: github.event_name == 'push'
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push to registry
uses: docker/build-push-action@v3
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}