forked from Arcnor/RetroHandhelds-Docker
-
Notifications
You must be signed in to change notification settings - Fork 4
46 lines (44 loc) · 1.63 KB
/
main.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
name: RetroHandhelds-Docker
on: [push]
jobs:
build-base:
name: Create & push images
runs-on: ubuntu-latest
steps:
- name: Login to Docker registry
uses: docker/login-action@25c0ca8bab9893f0962d4ffd043f2b7ab90e9a3f
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set lower case owner name (Docker workaround)
run: echo "OWNER_LC=${OWNER,,}" >>${GITHUB_ENV}
env:
OWNER: '${{ github.repository_owner }}'
- uses: actions/checkout@v2
# This is not needed for now, but for consistency's sake
- name: Replace variables for base
run: sed "s/%%GITHUB_OWNER%%/${{ env.OWNER_LC }}/g" Dockerfile.base > Dockerfile
- name: Build and push base image
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ghcr.io/${{ env.OWNER_LC }}/retro-toolchain/base:latest
# TODO: This can be paralelized
- name: Replace variables for buildroot
run: sed "s/%%GITHUB_OWNER%%/${{ env.OWNER_LC }}/g" Dockerfile.buildroot > Dockerfile
- name: Build and push buildroot image
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ghcr.io/${{ env.OWNER_LC }}/retro-toolchain/buildroot:latest
- name: Replace variables for toolchain
run: sed "s/%%GITHUB_OWNER%%/${{ env.OWNER_LC }}/g" Dockerfile.toolchain > Dockerfile
- name: Build and push toolchain image
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ghcr.io/${{ env.OWNER_LC }}/retro-toolchain/toolchain:latest