-
Notifications
You must be signed in to change notification settings - Fork 8
62 lines (56 loc) · 2.09 KB
/
release-prod.yaml
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
name: Release Docker Image (Production)
on:
push:
branches:
- main
paths:
- ".github/workflows/release-prod.yaml"
- "next/**/*"
workflow_dispatch:
jobs:
release:
name: Release Docker Image (Production)
runs-on: ubuntu-latest
environment:
name: production
env:
NEXT_PUBLIC_API_URL: ${{ vars.NEXT_PUBLIC_API_URL }}
NEXT_PUBLIC_SITE_NAME: ${{ vars.NEXT_PUBLIC_SITE_NAME }}
NEXT_PUBLIC_KEY_STRIPE: ${{ secrets.NEXT_PUBLIC_KEY_STRIPE }}
NEXT_PUBLIC_BASE_URL_FRONTEND: ${{ vars.NEXT_PUBLIC_BASE_URL_FRONTEND }}
NODE_ENV: ${{ vars.NODE_ENV }}
IMAGE_NAME: ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:production
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: main
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Import Secrets
id: import_secrets
uses: hashicorp/[email protected]
with:
url: https://vault.basedosdados.org
token: ${{ secrets.VAULT_TOKEN }}
secrets: |
secret/data/url_download_data URL_DOWNLOAD_CLOSED | URL_DOWNLOAD_CLOSED ;
secret/data/url_download_data URL_DOWNLOAD_OPEN | URL_DOWNLOAD_OPEN ;
- name: Build and push
uses: docker/build-push-action@v3
with:
context: next
file: next/Dockerfile
push: true
tags: ${{ env.IMAGE_NAME }}
build-args: |
NEXT_PUBLIC_API_URL=${{ env.NEXT_PUBLIC_API_URL }}
NEXT_PUBLIC_SITE_NAME=${{ env.NEXT_PUBLIC_SITE_NAME }}
NEXT_PUBLIC_KEY_STRIPE=${{ env.NEXT_PUBLIC_KEY_STRIPE }}
NEXT_PUBLIC_BASE_URL_FRONTEND=${{ env.NEXT_PUBLIC_BASE_URL_FRONTEND }}
URL_DOWNLOAD_CLOSED=${{ steps.import_secrets.outputs.URL_DOWNLOAD_CLOSED }}
URL_DOWNLOAD_OPEN=${{ steps.import_secrets.outputs.URL_DOWNLOAD_OPEN }}