-
Notifications
You must be signed in to change notification settings - Fork 17
45 lines (45 loc) · 1.43 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
name: Publish Docker
on:
push:
tags:
- v*
# # Temporary to test the action
# branches:
# - my/current-branch
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@master
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Publish to GitHub Container Registry
if: ${{ github.ref_type == 'tag' }} # Only useful when testing actions on a branch
uses: docker/build-push-action@v6
with:
push: true
tags: |
ghcr.io/libremfg/packml-simulator:${{ github.ref_name }}
ghcr.io/libremfg/packml-simulator:latest
# # Uncomment when testing actions on a branch
# - name: Publish to GitHub Container Registry on Branch
# if: ${{ github.ref_type == 'branch' }}
# uses: docker/build-push-action@v6
# with:
# push: true
# tags: |
# ghcr.io/libremfg/packml-simulator:test
- name: Publish to DockerHub Registry
if: ${{ github.ref_type == 'tag' }} # Only useful when testing actions on a branch
uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: spruiktec/packml-simulator
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}