mirror of https://github.com/pyodide/pyodide.git
79 lines
2.6 KiB
YAML
79 lines
2.6 KiB
YAML
name: pyodide-env-docker
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
version:
|
|
description: "Version of the docker image to build."
|
|
required: true
|
|
chrome_version:
|
|
description: "Version of the chrome browser (e.g. 97, 96)."
|
|
required: false
|
|
default: "latest"
|
|
firefox_version:
|
|
description: "Version of the firefox browser (e.g. 96, 95)."
|
|
required: false
|
|
default: "latest"
|
|
|
|
env:
|
|
GHCR_REGISTRY: ghcr.io
|
|
IMAGE_NAME: pyodide/pyodide-env
|
|
jobs:
|
|
build_docker:
|
|
runs-on: ubuntu-latest
|
|
environment: Docker
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v2
|
|
- name: Log into Docker Hub registry
|
|
uses: docker/login-action@v1
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
- name: Extract Docker metadata
|
|
id: meta
|
|
uses: docker/metadata-action@v3
|
|
with:
|
|
images: ${{ env.IMAGE_NAME }}
|
|
- name: Build and push Docker image to Docker Hub
|
|
id: build
|
|
uses: docker/build-push-action@v2
|
|
with:
|
|
file: ./Dockerfile
|
|
push: true
|
|
tags: ${{ env.IMAGE_NAME }}:${{ github.event.inputs.version }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
build-args: |
|
|
CHROME_VERSION=${{ github.event.inputs.chrome_version }}
|
|
FIREFOX_VERSION=${{ github.event.inputs.firefox_version }}
|
|
- name: Image digest
|
|
run: echo ${{ steps.build.outputs.digest }}
|
|
build_ghcr:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v2
|
|
- name: Log into registry ${{ env.GHCR_REGISTRY }}
|
|
uses: docker/login-action@v1
|
|
with:
|
|
registry: ${{ env.GHCR_REGISTRY }}
|
|
username: ${{ github.repository_owner }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
- name: Extract Docker metadata
|
|
id: meta
|
|
uses: docker/metadata-action@v3
|
|
with:
|
|
images: ${{ env.GHCR_REGISTRY }}/${{ env.IMAGE_NAME }}
|
|
- name: Build and push Docker image to ${{ env.GHCR_REGISTRY }}
|
|
id: build
|
|
uses: docker/build-push-action@v2
|
|
with:
|
|
file: ./Dockerfile
|
|
push: true
|
|
tags: ${{ env.GHCR_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.event.inputs.version }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
build-args: |
|
|
CHROME_VERSION=${{ github.event.inputs.chrome_version }}
|
|
FIREFOX_VERSION=${{ github.event.inputs.firefox_version }}
|
|
- name: Image digest
|
|
run: echo ${{ steps.build.outputs.digest }}
|