-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (38 loc) · 1.23 KB
/
Copy pathdeploy-master.yml
File metadata and controls
46 lines (38 loc) · 1.23 KB
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
name: Build and Push Docker Compose Image (master)
on:
push:
branches:
- master
tags-ignore:
- '**'
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
# Set up Docker Buildx. This step creates a buildx builder instance.
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
# Log in to GitHub Container Registry (GHCR)
- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GHCR_PAT }}
# Make empty .env file to avoid error in GHA
- name: Create empty .env & .token files
run: |
echo "" >> .env
echo "" >> .token
# Build the image using docker-compose (with platform option, if set in your compose file)
- name: Build image via docker-compose
run: |
export TAG=latest
docker compose build
# Push the image(s) defined in docker-compose.yml to the registry
- name: Push image via docker-compose
run: |
export TAG=latest
docker compose push