Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runs-on container image #4

Open
abernier opened this issue Jun 5, 2023 · 0 comments
Open

runs-on container image #4

abernier opened this issue Jun 5, 2023 · 0 comments
Assignees

Comments

@abernier
Copy link
Member

abernier commented Jun 5, 2023

Setup a Docker image for the runner, with an imagemagick version supporting DWAB compression

https://docs.github.com/en/actions/using-jobs/running-jobs-in-a-container

https://docs.github.com/en/actions/publishing-packages/publishing-docker-images#publishing-images-to-docker-hub

https://chat.openai.com/share/62aa46ca-9f23-4eb6-8f31-e45ce9add14b

FROM node:18-alpine

RUN apk update && apk add --no-cache imagemagick make openssl git

WORKDIR /app
# USER node
name: release
on:
  push:
    branches:
      - 'main'

# Cancel any previous run (see: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency)
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

jobs:

  changes-job:
    runs-on: ubuntu-latest
    outputs:
      dockerfile: ${{ steps.changes.outputs.dockerfile }}
    steps:
      - uses: actions/checkout@v3
      - id: changes
        uses: dorny/paths-filter@v2
        with:
          filters: |
            dockerfile:
              - 'Dockerfile'
          
  build-push-job:
    needs: changes-job
    if: needs.changes-job.outputs.dockerfile == 'true'
    runs-on: ubuntu-latest
    permissions:
      contents: read
      packages: write
    steps:
      - uses: actions/checkout@v3
      - uses: docker/login-action@v2
        with:
          registry: ghcr.io
          username: ${{ github.actor }}
          password: ${{ secrets.GITHUB_TOKEN }}
      - id: meta
        uses: docker/metadata-action@v4
        with:
          images: ghcr.io/${{ github.repository }}
      - uses: docker/build-push-action@v4
        with:
          context: .
          push: true
          tags: ${{ steps.meta.outputs.tags }}
          labels: ${{ steps.meta.outputs.labels }}

  release-job:
    needs: build-push-job
    if: always() && needs.build-push-job.result == 'success' || needs.build-push-job.result == 'skipped'
    runs-on: ubuntu-latest
    container:
      image: 'ghcr.io/${{ github.repository }}:main'
      # options: --user root
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-node@v3
        with:
          cache: 'yarn'
      - id: main
        run: |
          yarn install
          yarn build
          yarn release
        env:
          NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@abernier abernier self-assigned this Jun 5, 2023
@abernier abernier changed the title imagemagick with DWAB exr compression support runs-on container image Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant