-
Notifications
You must be signed in to change notification settings - Fork 11
50 lines (38 loc) · 1.23 KB
/
deploy.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: CI
on:
push:
branches: [main]
jobs:
build:
if: github.repository == 'chris-peterson/pwsh-gitlab'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Publish Module to PowerShell Gallery
uses: pcgeek86/publish-powershell-module-action@v20
id: publish-module
with:
NuGetApiKey: ${{ secrets.PS_GALLERY_KEY }}
environment:
name: PowerShell Gallery
url: https://www.powershellgallery.com/packages/GitlabCli
push:
if: github.repository == 'chris-peterson/pwsh-gitlab'
env:
IMAGE_NAME: gitlab-cli
IMAGE_VERSION: ${{ github.ref_name }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build image
run: docker build . --tag $IMAGE_NAME
- name: Log into registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Push image
if: ${{ github.ref_name == 'main' }}
env:
IMAGE_VERSION: latest
run: |
IMAGE_ID=ghcr.io/${{ github.repository }}/$IMAGE_NAME
docker tag $IMAGE_NAME $IMAGE_ID:$IMAGE_VERSION
docker push $IMAGE_ID:$IMAGE_VERSION