feature: Implement authentication for API v2 based on OAuth2 potocol. #317
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: Build and Publish Docker Image | |
on: | |
push: | |
branches: ["master"] | |
paths-ignore: ["**.md", "ext/**"] | |
pull_request: | |
branches: ["master"] | |
paths-ignore: ["**.md", "ext/**"] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
name: Checkout | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Build | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
outputs: type=docker,dest=/tmp/docker.tar | |
tags: bancho.py:${{ github.sha }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
- name: Upload artifact | |
uses: actions/[email protected] | |
with: | |
name: docker | |
path: /tmp/docker.tar | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
if: ${{ github.ref == 'refs/heads/master' }} | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Push to Docker Hub | |
uses: docker/build-push-action@v5 | |
if: ${{ github.ref == 'refs/heads/master' }} | |
with: | |
context: . | |
platforms: linux/amd64 | |
push: true | |
tags: | | |
${{ secrets.DOCKERHUB_USERNAME }}/bancho.py:latest | |
${{ secrets.DOCKERHUB_USERNAME }}/bancho.py:${{ github.sha }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max |