Skip to content

Combine workflows

Combine workflows #227

Workflow file for this run

name: test
on:
push:
branches:
- main
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: erlef/setup-beam@v1
with:
otp-version: "27.1.2"
gleam-version: "1.6.3"
rebar3-version: "3"
- run: gleam test
- run: gleam format --check src test
build-container:
runs-on: ubuntu-latest
needs: test
if: github.ref == 'refs/heads/main'
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v4
- name: Log in to registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Build image
run: docker build . --file Dockerfile --tag app
- name: Push image
run: |
TAG=ghcr.io/gleam-lang/packages:main
docker tag app $TAG
docker push $TAG