-
Notifications
You must be signed in to change notification settings - Fork 7
55 lines (48 loc) · 1.71 KB
/
Copy pathdocker-build.yml
File metadata and controls
55 lines (48 loc) · 1.71 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Build Docker
# Controls when the action will run. Triggers the workflow for a pull request for
# master
on:
pull_request:
branches: [ staging, master ]
paths: [ docker/Dockerfile ]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Load 1Password secrets
uses: 1password/load-secrets-action@v1
with:
export-env: true
env:
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.TRAINING_OP_SERVICE_ACCOUNT_TOKEN }}
ACTION_MONITORING_SLACK: ${{ secrets.OP_ACTION_MONITORING_SLACK }}
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout code
uses: actions/checkout@v3
# set up Docker build
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
# Build docker image
- name: Build Docker image
uses: docker/build-push-action@v4
with:
push: false
context: docker
file: docker/Dockerfile
tags: ccdl/refinebio-examples:latest
cache-from: type=gha
cache-to: type=gha,mode=max
# If we have a failure, Slack us
- name: Report failure to Slack
if: always()
uses: ravsamhq/notify-slack-action@v2
with:
status: ${{ job.status }}
notify_when: 'failure'
env:
SLACK_WEBHOOK_URL: ${{ env.ACTION_MONITORING_SLACK }}
SLACK_MESSAGE: 'Build Docker failed'