-
Notifications
You must be signed in to change notification settings - Fork 1
40 lines (38 loc) · 1.32 KB
/
deploy.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
40
name: deploy_new_fitzroy
on: workflow_dispatch
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Build image
# We don't build from cache, because this job is for installing
# an updated version of the fitzRoy package from 'main',
# which usually doesn't involve cache-busting changes to our
# image.
run: |
docker build \
-t cfranklin11/tipresias_afl_data:latest \
-f ./Dockerfile .
- name: Login to Docker Hub
if: ${{ github.ref == 'refs/heads/main' }}
uses: docker/login-action@v1
with:
username: cfranklin11
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Push updated images
if: ${{ github.ref == 'refs/heads/main' }}
run: |
docker push cfranklin11/tipresias_afl_data:latest
- name: Set up Google Cloud SDK
uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
with:
project_id: ${{ secrets.PROJECT_ID }}
service_account_key: ${{ secrets.GC_SA_KEY }}
- name: Deploy
if: ${{ github.ref == 'refs/heads/main' }}
env:
GCR_TOKEN: ${{ secrets.GCR_TOKEN }}
PROJECT_ID: ${{ secrets.PROJECT_ID }}
run: ./scripts/deploy.sh