Skip to content

GitHub token

GitHub token #59

name: smk-composite-action-tests
# used on push for testing / development
# on:
# push:
on:
pull_request:
# debug: remove the dev,putting build action on non existent branches for debug
branches: ['master', 'main']
types: ['opened', 'reopened']
paths-ignore:
- openshift/**
- .vscode/**
- docs/**
- .gitignore
- LICENSE
- open-api.json
- readme.md
- helm-charts
- code_of_conduct.md
jobs:
# This workflow contains a single job called "build"
buildjob:
defaults:
run:
shell: bash
name: 'Build SMK container image'
# The type of runner that the job will run on
runs-on: ubuntu-latest
env:
OPENSHIFT_SERVER_URL: ${{secrets.OPENSHIFT_SERVER_URL}}
OPENSHIFT_TOKEN_DEV: ${{secrets.OPENSHIFT_TOKEN_DEV}}
OPENSHIFT_TOKEN_PROD: ${{secrets.OPENSHIFT_TOKEN_PROD}}
GHCR_USER: ${{ secrets.GHCR_USER }}
GHCR_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DEBUG_DEPLOY: false
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
if: env.DEBUG_DEPLOY == 'false'
id: checkout
with:
fetch-depth: 0
- name: Building image
uses: bcgov/smk-actions/smk-build@github_token
id: buildSMKImage
with:
OPENSHIFT_SERVER_URL: ${{ secrets.OPENSHIFT_SERVER_URL }}
OPENSHIFT_TOKEN_DEV: ${{ secrets.OPENSHIFT_TOKEN_DEV }}
GHCR_USER: ${{ secrets.GHCR_USER }}
GHCR_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCKER_REGISTRY: 'ghcr.io'
- name: deploying dev
uses: bcgov/smk-actions/smk-deploy@github_token
id: deploySMKContainer
with:
OPENSHIFT_SERVER_URL: ${{ secrets.OPENSHIFT_SERVER_URL }}
OPENSHIFT_TOKEN_DEV: ${{ secrets.OPENSHIFT_TOKEN_DEV }}
GHCR_USER: ${{ secrets.GHCR_USER }}
GHCR_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCKER_REGISTRY: 'ghcr.io'
PR_REVIEWERS: '["michaelpnelson"]'
PR_MENTIONS: '["michaelpnelson"]'
- name: Deleting older images
uses: actions/delete-package-versions@v5
with:
package-name: 'smk-firewood/smk-firewood'
package-type: 'container'
token: ${{ secrets.GITHUB_TOKEN }}
min-versions-to-keep: 10