-
Notifications
You must be signed in to change notification settings - Fork 6
68 lines (55 loc) · 2.13 KB
/
deploy_image.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# GNU Lesser General Public License v3.0 only
# Copyright (C) 2020 Artefact
# licence-information@artefact.com
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 3 of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# TO CONFIGURE THIS WORKFLOW
# 1. Set up secrets in your workspace:
# - GCP_PROJECT with the name of the project
# - GCP_EMAIL with the service account email
# - GCP_KEY with the service account key
# 2. Deployment infos are by now in the .env module:
# don't forget to change the version when updating the master branch.
name: Build and publish Docker image to GCP Container Registry
on:
pull_request:
types: [closed]
# Environment variables available to all jobs and steps in this workflow:
env:
GCP_EMAIL: ${{ secrets.GCP_EMAIL }}
PROJECT_ID: ${{ secrets.PROJECT_ID }}
DOCKER_TAG: ${{ github.run_id }}
DOCKER_REGISTRY: ${{ secrets.DOCKER_REGISTRY }}
DOCKER_IMAGE: ${{ secrets.DOCKER_IMAGE }}-${{ github.ref }}
CLOUDSDK_PYTHON_SITEPACKAGES: 1
jobs:
build-and-deploy:
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup gcloud CLI
uses: google-github-actions/setup-gcloud@master
with:
version: '290.0.1'
service_account_email: ${{ secrets.GCP_EMAIL }}
service_account_key: ${{ secrets.GCP_KEY }}
- name: Clean .env
run: |
> .env
- name: Build and publish Docker image
run: |
make publish_base_image