-
Notifications
You must be signed in to change notification settings - Fork 11
51 lines (39 loc) · 1.24 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
51
name: CI
on:
push:
branches: [fix-ci]
jobs:
build:
if: github.repository == 'chris-peterson/pwsh-gitlab'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Publish PowerShell Module
uses: natescherer/publish-powershell-action@v1.1.1
with:
token: ${{ secrets.PS_GALLERY_KEY }}
target: gallery
path: src/GitlabCli
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