-
Notifications
You must be signed in to change notification settings - Fork 201
81 lines (77 loc) · 3.01 KB
/
publish-release.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
68
69
70
71
72
73
74
75
76
77
78
79
80
name: publish-release
on:
push:
tags: [ 'v*.*.*' ]
jobs:
publish-powershell-gallery:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
- name: publishing
run: |
Install-Module -Name powershell-yaml -Force
Publish-Module -Path '.' -NuGetApiKey ${{ secrets.PGALLERY }}
shell: pwsh
build-docker-containers:
name: Build and Publish Containers
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 3
matrix:
os: [ubuntu-latest, windows-latest]
include:
- os: ubuntu-latest
file: docker/Dockerfile
tag: redcanary/invoke-atomicredteam:${{ github.sha }}-linux-amd64
latest: redcanary/invoke-atomicredteam:latest-linux-amd64
- os: windows-latest
file: docker/Dockerfile
tag: redcanary/invoke-atomicredteam:${{ github.sha }}-windows-amd64
latest: redcanary/invoke-atomicredteam:latest-windows-amd64
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: svcdockerhubatomicredteam
password: ${{ secrets.DOCKER_TOKEN }}
- name: Docker Build
run: |
docker build docker -f ${{ matrix.file }} -t ${{ matrix.tag }}
docker build docker -f ${{ matrix.file }} -t ${{ matrix.latest }}
- name: Docker Push
run: |
docker push ${{ matrix.tag }}
docker push ${{ matrix.latest }}
publish-manfiest:
name: Publish Manifest
runs-on: ubuntu-latest
needs: build-docker-containers
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: svcdockerhubatomicredteam
password: ${{ secrets.DOCKER_TOKEN }}
- name: Docker Manifest
run: |
docker manifest create redcanary/invoke-atomicredteam:latest \
--amend redcanary/invoke-atomicredteam:${{ github.sha }}-linux-amd64 \
--amend redcanary/invoke-atomicredteam:${{ github.sha }}-windows-amd64
docker manifest create redcanary/invoke-atomicredteam:${{ github.sha }} \
--amend redcanary/invoke-atomicredteam:${{ github.sha }}-linux-amd64 \
--amend redcanary/invoke-atomicredteam:${{ github.sha }}-windows-amd64
- name: Docker Annotate
run: |
docker manifest annotate --os windows --arch amd64 \
redcanary/invoke-atomicredteam:latest redcanary/invoke-atomicredteam:${{ github.sha }}-windows-amd64
docker manifest annotate --os windows --arch amd64 \
redcanary/invoke-atomicredteam:${{ github.sha }} redcanary/invoke-atomicredteam:${{ github.sha }}-windows-amd64
- name: Docker Push
run: |
docker manifest push redcanary/invoke-atomicredteam:${{ github.sha }}
docker manifest push redcanary/invoke-atomicredteam:latest