Skip to content

Commit

Permalink
add extra labels and configs to docker workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelwoods committed Dec 2, 2020
1 parent e029012 commit 458fd52
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 11 deletions.
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ updates:
directory: "/"
schedule:
interval: "daily"
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "daily"
23 changes: 17 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ on:
branches: [ main ]
pull_request:
branches: [ main ]

# build weekly for fresh base docker image
schedule:
- cron: '30 4 * * 1'

jobs:
test_build_push:
name: Test and Build & Push Docker image

name: ci - test, build, push
runs-on: ubuntu-latest

strategy:
Expand All @@ -20,11 +22,17 @@ jobs:
- name: Check out the repo
uses: actions/checkout@v2

- name: Docker meta
id: docker_meta
uses: crazy-max/ghaction-docker-meta@v1
with:
images: michaelwoods/onstar2mqtt
tag-sha: true

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- run: npm ci
- run: npm run build --if-present
- run: npm test
Expand All @@ -34,12 +42,15 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Push to Docker Hub
uses: docker/build-push-action@v2
with:
push: true
tags: michaelwoods/onstar2mqtt:latest
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
28 changes: 23 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,36 @@
name: release

on:
release:
types: [published]
jobs:
push_to_registry:
name: Push Docker image to Docker Hub
name: release - build, push
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Push to Docker Hub
uses: docker/build-push-action@v1

- name: Docker meta
id: docker_meta
uses: crazy-max/ghaction-docker-meta@v1
with:
images: michaelwoods/onstar2mqtt
tag-sha: true

- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: michaelwoods/onstar2mqtt
tag_with_ref: true
- name: Push to Docker Hub
uses: docker/build-push-action@v2
with:
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}

0 comments on commit 458fd52

Please sign in to comment.