-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (37 loc) · 1.04 KB
/
docker.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
# version 1.0
name: Build and push
on:
push:
tags:
- "*"
jobs:
work:
name: Work
runs-on: ubuntu-latest
steps:
- name: Check out the code
uses: actions/checkout@v2
- name: Lowercase
id: lower
uses: ASzc/change-string-case-action@v1
with:
string: ${{ github.repository }}
- name: Agregar envs
run: |
if [[ "${GITHUB_REF#refs/tags/}" == *"beta"* ]]; then
echo "${{ secrets.ENV_STAGING }}" > .env.local
else
echo "${{ secrets.ENV_PRODUCTION }}" > .env.local
fi
- name: Build & Push docker image
uses: mr-smithers-excellent/docker-build-push@v4
with:
image: ${{ steps.lower.outputs.lowercase }}
registry: ghcr.io
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Notify Slack
uses: craftech-io/slack-action@v1
with:
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK }}
if: always()