This repository has been archived by the owner on May 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 112
50 lines (48 loc) · 1.63 KB
/
build_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
---
name: Build & deploy Docker images
on:
push:
paths:
- "docker/Dockerfile*"
release:
types: [released]
jobs:
build_and_publish:
name: Build and Publish Ubuntu Images
runs-on: ubuntu-latest
strategy:
matrix:
distro: ["xenial", "bionic", "focal"]
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Docker login
uses: docker/login-action@v2
with:
username: edran
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: ${{ format('Build & Publish `dev` {0} image', matrix.distro) }}
uses: docker/build-push-action@v2
with:
file: ${{ format('docker/Dockerfile-{0}', matrix.distro) }}
tags: ${{ format('fairnle/nle-{0}', matrix.distro) }}:latest
tag_with_sha: true
add_git_labels: true
push: false # Build on PR only.
- name: Check Version Matches Release Tag (Release Only)
if: github.event_name == 'release' && github.event.action == 'released'
run: |
echo "v$(cat version.txt)"
echo "${{ github.event.release.tag_name }}"
[[ "${{ github.event.release.tag_name }}" == "v$(cat version.txt)" ]]
- name: Push Version Tag (Release Only)
if: github.event_name == 'release' && github.event.action == 'released'
uses: docker/build-push-action@v2
with:
file: ${{ format('docker/Dockerfile-{0}', matrix.distro) }}
tags: |
${{ format('fairnle/nle-{0}', matrix.distro) }}:latest,
${{ format('fairnle/nle-{0}', matrix.distro) }}:${{ github.event.release.tag_name }}
add_git_labels: true
push: true