Use GitHub actions

This commit is contained in:
Jan-Lukas Else 2022-03-24 19:51:22 +01:00
parent a5bdb23979
commit 1d1b3053ce
2 changed files with 32 additions and 38 deletions

View File

@ -1,38 +0,0 @@
kind: pipeline
name: default
type: docker
steps:
- name: build
image: docker:dind
volumes:
- name: dockersock
path: /var/run
environment:
DOCKER_PASSWORD:
from_secret: docker_password
commands:
- sleep 5 # give docker enough time to start
- echo $DOCKER_PASSWORD | docker login --username jlelse --password-stdin ghcr.io
- DOCKER_BUILDKIT=1 docker build -t temptest . --target test
- DOCKER_BUILDKIT=1 docker build -t ghcr.io/jlelse/goblog:latest . --target base
- DOCKER_BUILDKIT=1 docker build -t ghcr.io/jlelse/goblog:tools . --target tools
- docker push --all-tags ghcr.io/jlelse/goblog
services:
- name: docker
image: docker:dind
privileged: true
volumes:
- name: dockersock
path: /var/run
volumes:
- name: dockersock
temp: {}
trigger:
branch:
- master
event:
- push

View File

@ -0,0 +1,32 @@
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