-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2f9165d
commit 97d280e
Showing
1 changed file
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
name: Build images | ||
|
||
on: | ||
pull_request: | ||
types: [opened, reopened] | ||
push: | ||
branches: | ||
- '**' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
continue-on-error: true | ||
permissions: | ||
packages: write | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
# list of Docker images to use as base name for tags | ||
images: | | ||
ghcr.io/${{ github.repository_owner }}/ci-bridge | ||
# generate Docker tags based on the following events/attributes | ||
tags: | | ||
type=schedule | ||
type=ref,event=branch | ||
type=ref,event=pr | ||
type=semver,pattern={{version}} | ||
type=semver,pattern={{major}}.{{minor}} | ||
type=semver,pattern={{major}} | ||
type=raw,value=latest,enable={{is_default_branch}} | ||
type=sha | ||
- name: Build and push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/ci-bridge:buildcache | ||
cache-to: type=registry,ref=ghcr.io/${{ github.repository_owner }}/ci-bridge:buildcache,mode=max | ||
|
||
# deploy: | ||
# runs-on: ubuntu-latest | ||
# if: github.ref == 'refs/heads/main' | ||
# needs: | ||
# - build | ||
# env: | ||
# SERVER: https://api.paas.okd.cern.ch | ||
# PROJECT: acts-ci-bridge | ||
# APP_NAME: ci-bridge | ||
# steps: | ||
# - name: Trigger redeploy | ||
# run: > | ||
# which sshpass | ||
# && sshpass -p ${{ secrets.PWD }} ssh -o StrictHostKeyChecking=no ${{ secrets.USER }}@lxplus9.cern.ch | ||
# 'oc login ${{ env.SERVER }} --token=${{ secrets.DEPLOY_TOKEN }} | ||
# && oc project ${{ env.PROJECT }} | ||
# && oc import-image ${{ env.APP_NAME }} --all' |