-
Notifications
You must be signed in to change notification settings - Fork 8
45 lines (42 loc) · 1.4 KB
/
build-container.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
name: 'Build amc2moodle container'
on:
push:
# branches:
# - 'master'
tags:
- 'v*'
jobs:
build:
name: 'Build amc2moodle container'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- id: docker-tag
uses: yuya-takeyama/docker-tag-from-github-ref-action@main
with:
latest-branches: 'main,master'
- name: "Build:checkout"
uses: actions/checkout@main
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@main
- name: Login to Github Packages
uses: docker/login-action@main
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.PAT }}
- name: 'Build:dockerimage'
id: docker_build
uses: docker/build-push-action@main
with:
# relative path to the place where source code with Dockerfile is located
context: ./docker
tags: ghcr.io/${{ github.repository_owner }}/amc2moodle:${{ steps.docker-tag.outputs.tag }},ghcr.io/${{ github.repository_owner }}/amc2moodle:latest
push: true
cache-from: type=gha
cache-to: type=gha
# # build on feature branches, push only on main branch
# push: ${{ github.ref == 'refs/heads/main' }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}