forked from Team-Kujira/oracle-price-feeder
-
Notifications
You must be signed in to change notification settings - Fork 2
39 lines (39 loc) · 1.21 KB
/
docker.yml
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
32
33
34
35
36
37
38
39
---
name: Docker build and publish
on:
push:
branches: [ "main", "dev" ]
tags: [ 'v*' ]
pull_request:
branches: [ "main" ]
env:
REGISTRY: ghcr.io
REPO: ${{ github.repository }}
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Install just
uses: extractions/setup-just@v1
with:
just-version: 1.33.0
- name: Docker build and publish ${{ env.REGISTRY }}:${{ env.REPO }}
if: github.event_name != 'pull_request'
run: just docker-ci "${REGISTRY}/${REPO}"
- name: Docker build (PR validate)
if: github.event.name == 'pull_request'
run: just docker-build