Skip to content

Update build-and-deploy.yml #16

Update build-and-deploy.yml

Update build-and-deploy.yml #16

name: Create image and Deploy
env:
IMAGE_TAG: php-proxy-for-blazegraph:latest
on:
push:
branches:
- 'master'
jobs:
build_and_push_to_registry:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Pack Build
uses: dfreilich/[email protected]
with:
args: 'build tmp-cnb-image --builder heroku/buildpacks:20'
- name: Suggest default port 5000 within image
run: |
cat >> Dockerfile <<EOF
FROM tmp-cnb-image
ENV PORT=5000
EXPOSE 5000
EOF
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64
push: true
tags: |
ghcr.io/acdh-oeaw/${{ env.IMAGE_TAG }}
rancher:
needs: build_and_push_to_registry
name: Deploy to rancher
runs-on: ubuntu-20.04
steps:
- name: Rancher Deploy Action
run: |
curl -i -X POST "${{ secrets.RANCHERURL_ARCHE_SPARQL }}?action=redeploy" -H "Authorization: Bearer ${{ secrets.RANCHER_BARER_TOKEN }}"
curl -i -X POST "${{ secrets.RANCHERURL_SK_SPARQL }}?action=redeploy" -H "Authorization: Bearer ${{ secrets.RANCHER_BARER_TOKEN }}"