-
Notifications
You must be signed in to change notification settings - Fork 1
45 lines (34 loc) · 1.25 KB
/
docker-release.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
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# GitHub recommends pinning actions to a commit SHA.
# To get a newer version, you will need to update the SHA.
# You can also reference a tag or branch, but the action may change without warning.
name: Release Docker Images
on:
push:
branches: [ "main" ]
release:
types: [published]
jobs:
push_to_registry:
name: Push Docker images to Docker Hub
runs-on: ubuntu-latest
defaults:
run:
working-directory: code
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Make envfile
run: echo "${{ secrets.ENV_FILE }}" > .env
- name: Log in to Docker Hub
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
- name: Build Docker image
run: docker-compose -f docker-compose.prod.yml build
- name: Push Docker images
run: docker-compose -f docker-compose.prod.yml push