Update build-and-deploy.yml #14
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
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@v2 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Pack Build | |
uses: dfreilich/pack-action@v2 | |
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 }}" |