Skip to content

Update runtimes

Update runtimes #7

name: Build api-problem4restxq
env:
BUILDPACK_URL: https://github.com/simar0at/heroku-buildpack-basex
DOCKER_TAG: ghcr.io/acdh-oeaw/api-problem4restxq
on:
push:
branches:
- "master"
repository_dispatch:
types: [run]
jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: checkout
uses: actions/checkout@v4
- name: generate build instructions using herokuish
run: |
cat <<EOF > Dockerfile
FROM gliderlabs/herokuish:latest-22 as builder
COPY . /tmp/app
ARG BUILDPACK_URL
ENV USER=herokuishuser
RUN /bin/herokuish buildpack build
FROM gliderlabs/herokuish:latest-22
COPY --chown=herokuishuser:herokuishuser --from=builder /app /app
ENV PORT=5000
ENV USER=herokuishuser
EXPOSE 5000
CMD ["/bin/herokuish", "procfile", "start", "web"]
EOF
- name: login to github container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Create tags based on git data
id: meta
uses: docker/metadata-action@v5
with:
images: |
${{ env.DOCKER_TAG }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=raw,value=latest,enable={{is_default_branch}}
type=raw,value={{sha}}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
build-args: |
BUILDPACK_URL=${{ env.BUILDPACK_URL }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
push: true
test:
runs-on: ubuntu-22.04
steps:
- name: checkout
uses: actions/checkout@v4
- name: Run tests using heroku buildpack
run: |
cat <<EOF > Dockerfile
FROM gliderlabs/herokuish:latest-22
COPY . /tmp/app
ENV BUILDPACK_URL=${{ env.BUILDPACK_URL }}
ENV USER=herokuishuser
EOF
docker build --tag ${{ env.DOCKER_TAG }}:${{ github.ref_name }}-test .
docker run --rm -t ${{ env.DOCKER_TAG }}:${{ github.ref_name }}-test /bin/herokuish buildpack test