Use GitHub actions

pull/25/head
Jan-Lukas Else 9 months ago
parent a5bdb23979
commit 1d1b3053ce
  1. 38
      .drone.yml
  2. 32
      .github/workflows/build-docker-images.yml

@ -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

@ -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
Loading…
Cancel
Save