Skip to content

Commit

Permalink
Add docker build action
Browse files Browse the repository at this point in the history
  • Loading branch information
JElgar committed Aug 26, 2024
1 parent 3b348fe commit d714ca1
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 1 deletion.
46 changes: 46 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Build & publish

on:
push:
branches: [ main ]

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
check:
name: Build, lint & test
uses: now-u/now-u-app-links/.github/workflows/check.yml@main
secrets: inherit

build:
name: Build & publish
runs-on: ubuntu-latest
needs: check
steps:
- uses: actions/checkout@v4

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- uses: actions/setup-node@v4

- name: Docker metadata
id: meta
uses: docker/metadata-action@v4
with:
images: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: type=sha

- name: Build and push
uses: docker/build-push-action@v4
with:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
3 changes: 2 additions & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ on:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_call:

env:
CARGO_TERM_COLOR: always

jobs:
build:
check:
runs-on: ubuntu-latest

steps:
Expand Down

0 comments on commit d714ca1

Please sign in to comment.