-
Notifications
You must be signed in to change notification settings - Fork 0
31 lines (31 loc) · 1010 Bytes
/
Copy pathbuild-snapshots.yml
File metadata and controls
31 lines (31 loc) · 1010 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
name: Snapshot Build
on:
push:
branches: [main]
jobs:
build:
name: Build and Publish Docker Image
runs-on: ubuntu-latest
strategy:
matrix: { project: ['dashboard', 'runner'] }
steps:
- name: Clone Repository
uses: actions/checkout@v3
- name: Get Short Hash
id: commit
uses: pr-mpt/actions-commit-hash@v2
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Authenticate with Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Build and Publish Image
uses: docker/build-push-action@v2
with:
context: ${{ matrix.project }}
tags: ${{ secrets.DOCKERHUB_USERNAME }}/candor-${{ matrix.project }}:${{ steps.commit.outputs.short }}
build-args: |
CANDOR_BUILD_VERSION=${{ steps.commit.outputs.short }}
push: true