discord-active-developer-badge/.github/workflows/main.yml
Workflow config file is invalid. Please check your config file: yaml: line 23: mapping values are not allowed in this context
2024-04-08 00:37:38 +07:00

52 lines
1.1 KiB
YAML

name: Docker Build
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Build Docker image
run: docker build -t discord-badge .
- name: Run Docker container
run: |
docker run -d -e TOKEN=${{ secrets.DISCORD_TOKEN }} discord-badge
name: Publish Docker Image
on:
push:
branches:
- main # Trigger the workflow on pushes to the main branch
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Login to GitHub Packages Docker registry
run: echo "${{ secrets.GH_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.repository_owner }} --password-stdin
- name: Build Docker image
run: docker build -t docker.pkg.github.com/${{ github.repository }}/discord-badge:latest .
- name: Push Docker image
run: docker push docker.pkg.github.com/${{ github.repository }}/discord-badge:latest