Update docker-deploy. #1
Workflow file for this run
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: Upload Python Package | |
on: | |
push: | |
branches: ["docker-push-arm64"] | |
workflow_dispatch: | |
# release: | |
# types: [published] | |
env: | |
REGISTRY: ghcr.io | |
DOCKER_REGISTRY: docker.io | |
DOCKER_REGISTRY_USER: sohma440 # todo: | |
IMAGE_NAME: ${{ github.repository }} | |
jobs: | |
# pypi-deploy: | |
# if: ${{ false }} | |
# runs-on: ubuntu-latest | |
# steps: | |
# - uses: actions/checkout@v3 | |
# - name: Set up Python | |
# uses: actions/setup-python@v4 | |
# with: | |
# python-version: '3.x' | |
# - name: Install dependencies | |
# run: | | |
# python -m pip install --upgrade pip | |
# pip install setuptools wheel pipenv | |
# - name: Build | |
# run: | | |
# python setup.py sdist bdist_wheel | |
# - name: Publish a Python distribution to PyPI | |
# uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 | |
# with: | |
# user: __token__ | |
# password: ${{ secrets.PYPI_API_TOKEN }} | |
docker-deploy: | |
runs-on: ubuntu-latest | |
# needs: pypi-deploy | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Git checkout | |
uses: actions/checkout@v3 | |
- name: Enable buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Log in to the GitHub Container registry | |
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta_gh | |
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc | |
with: | |
context: . | |
push: true | |
tags: ${{ steps.meta_gh.outputs.tags }} | |
labels: ${{ steps.meta_gh.outputs.labels }} | |
- name: Log in to the Docker Container registry | |
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 | |
with: | |
registry: ${{ env.DOCKER_REGISTRY }} | |
username: ${{ env.DOCKER_REGISTRY_USER }} | |
password: ${{ secrets.DH_ACCESS_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta_dh | |
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 | |
with: | |
images: ${{ env.DOCKER_REGISTRY }}/${{ env.IMAGE_NAME }} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc | |
with: | |
context: . | |
push: true | |
tags: ${{ steps.meta_dh.outputs.tags }} | |
labels: ${{ steps.meta_dh.outputs.labels }} |