-
Notifications
You must be signed in to change notification settings - Fork 2
67 lines (57 loc) · 2.4 KB
/
docker.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Docker Image CI
on:
merge_group:
types: [checks_requested]
pull_request:
types:
- opened
- reopened
- synchronize
branches:
- eol-release/**
- openuchile-release/**
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
variables:
uses: eol-uchile/edx-platform/.github/workflows/variables.yml@eol/koa.master # TODO: points to eol-release trunk
build:
needs: [ variables ]
runs-on: ubuntu-latest
permissions:
packages: write
env:
TS: ${{ needs.variables.outputs.timestamp }}
RELEASE-NAME: ${{ needs.variables.outputs.release-name }}
PROJECT: ${{ needs.variables.outputs.project }}
CODE: ${{ needs.variables.outputs.code }}
steps:
- uses: actions/checkout@v4
- name: Pull submodules
run: git submodule update --init --recursive
- name: Build Open edX
run: docker build . --file ./Dockerfile --tag ghcr.io/eol-uchile/edx-staging:${{ env.CODE }}-${{ env.RELEASE-NAME }} --tag ghcr.io/eol-uchile/edx-staging:${{ env.CODE }}-${{ env.RELEASE-NAME }}-${{ env.TS }} --target base
- name: Build Static files for OpenedX S3
run: docker build . --file ./Dockerfile --tag ghcr.io/eol-uchile/edx-staging:s3-static-${{ env.CODE }}-${{ env.RELEASE-NAME }} --tag ghcr.io/eol-uchile/edx-staging:s3-static-${{ env.CODE }}-${{ env.RELEASE-NAME }}-${{ env.TS }} --target s3
- name: Login to GitHub Container Registry
if: ${{ github.event_name == 'merge_group' }}
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push
if: ${{ github.event_name == 'merge_group' }}
run: |
docker push ghcr.io/eol-uchile/edx-staging:${{ env.CODE }}-${{ env.RELEASE-NAME }}
docker push ghcr.io/eol-uchile/edx-staging:${{ env.CODE }}-${{ env.RELEASE-NAME }}-${{ env.TS }}
docker push ghcr.io/eol-uchile/edx-staging:s3-static-${{ env.CODE }}-${{ env.RELEASE-NAME }}
docker push ghcr.io/eol-uchile/edx-staging:s3-static-${{ env.CODE }}-${{ env.RELEASE-NAME }}-${{ env.TS }}
webhook:
needs: [ variables, build ]
if: ${{ github.event_name == 'merge_group' }}
uses: ./.github/workflows/webhook.yml
with:
code: ${{ needs.variables.outputs.code }}
secrets: inherit