Skip to content

Update readme and add token generation script. #24

Update readme and add token generation script.

Update readme and add token generation script. #24

Workflow file for this run

name: Build and Push Docker Image
on:
push:
branches: [ "main" ]
tags: [ "v*" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
inputs:
force_push:
description: 'Force push Docker image'
required: false
default: false
type: boolean
env:
IMAGE_NAME: hackertwo/hackerone-graphql-mcp-server
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Check if should push
id: should_push
run: |
if [[ "${{ github.event_name }}" != "pull_request" ]]; then
echo "should_push=true" >> $GITHUB_OUTPUT
elif [[ "${{ github.event.inputs.force_push }}" == "true" ]]; then
echo "should_push=true" >> $GITHUB_OUTPUT
elif [[ "${{ contains(github.event.pull_request.labels.*.name, 'docker-push') }}" == "true" ]]; then
echo "should_push=true" >> $GITHUB_OUTPUT
else
echo "should_push=false" >> $GITHUB_OUTPUT
fi
- name: Log in to Docker Hub
if: steps.should_push.outputs.should_push == 'true'
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE_NAME }}
tags: |
type=ref,event=pr
type=semver,pattern={{version}}
type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/v') }}
type=raw,value=dev-main,enable={{is_default_branch}}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: ${{ steps.should_push.outputs.should_push == 'true' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max