Skip to content

Commit

Permalink
Migrate to Github Actions (#91)
Browse files Browse the repository at this point in the history
* Migrate to Github Actions
  • Loading branch information
jdel authored Feb 19, 2022
1 parent 5de332d commit 73e9096
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 8 deletions.
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
81 changes: 81 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Docker Build

on:
push:
branches:
- master
tags:
- v*.*.*
paths-ignore:
- README.md
pull_request:
branches:
- master
paths-ignore:
- README.md

jobs:
release:
runs-on: ubuntu-20.04
needs: build
if: ${{ github.ref_type == 'tag' }}

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Create Release
run: |
gh release create \
--generate-notes \
--title ${{ github.ref_name }} \
${{ github.ref_name }}
build:
runs-on: ubuntu-20.04

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Docker metadata
id: metadata
uses: docker/metadata-action@v3
with:
images: |
${{ github.repository }}
ghcr.io/${{ github.repository }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern=v{{version}}
type=semver,pattern=v{{major}}.{{minor}}
type=semver,pattern=v{{major}}
- name: Login to Docker Hub
uses: docker/login-action@v1
if: ${{ github.event_name != 'pull_request' }}
with:
username: ${{ github.repository_owner }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
if: ${{ github.event_name != 'pull_request' }}
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build
uses: docker/build-push-action@v2
with:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}
build-args: |
BRANCH=${{ github.ref_name }}
COMMIT=${{ github.sha }}
8 changes: 0 additions & 8 deletions .travis.yml

This file was deleted.

0 comments on commit 73e9096

Please sign in to comment.