mirror of https://github.com/jlelse/GoBlog
32 lines
965 B
YAML
32 lines
965 B
YAML
name: Build Docker images
|
|
|
|
on:
|
|
push:
|
|
branches: [ master ]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v1
|
|
with:
|
|
config-inline: |
|
|
[registry."docker.io"]
|
|
mirrors = ["mirror.gcr.io"]
|
|
- name: Login to GitHub container registry
|
|
uses: docker/login-action@v1
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
- name: Test
|
|
run: DOCKER_BUILDKIT=1 docker build -t temptest . --target test
|
|
- name: Build base image
|
|
run: DOCKER_BUILDKIT=1 docker build -t ghcr.io/jlelse/goblog:latest . --target base
|
|
- name: Build tools image
|
|
run: DOCKER_BUILDKIT=1 docker build -t ghcr.io/jlelse/goblog:tools . --target tools
|
|
- name: Push images
|
|
run: docker push --all-tags ghcr.io/jlelse/goblog |