loconotion/.github/workflows/docker.yml
Martynas Mickevičius 64358ff2e5
Build and push to ghcr
Adds a GitHub Actions job that builds and pushes docker image to GitHub
Container Registry.

Image tags and labels are managed by the default strategy of
https://github.com/docker/metadata-action#basic action.

Also browser and driver versions are updated to the latest.
2022-03-19 13:50:41 +02:00

45 lines
1.0 KiB
YAML

name: Docker Image
on:
push:
branches:
- '**'
tags:
- 'v*.*.*'
pull_request:
branches:
- 'master'
jobs:
build-and-push-docker-image:
name: Build Docker image and push to repository
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: ghcr.io/${{ github.repository }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to Github Packages
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build image and push to GitHub Container Registry
uses: docker/build-push-action@v2
with:
file: ./docker/Dockerfile
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
push: true