Skip to content

Upsert protected branches #299

Upsert protected branches

Upsert protected branches #299

Workflow file for this run

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:
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