Update github actions to use 1password #221
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |