metadata/.github/workflows/ci.yml

42 lines
1.0 KiB
YAML
Raw Normal View History

2024-04-04 20:09:04 +00:00
name: ci
on:
- push
jobs:
docker:
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
2025-02-25 19:56:29 +00:00
permissions:
contents: read
packages: write
2025-02-25 20:37:56 +00:00
id-token: write
2025-02-25 19:56:29 +00:00
2024-04-04 20:09:04 +00:00
steps:
2025-02-25 20:46:54 +00:00
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
registry-url: "https://npm.pkg.github.com"
scope: "@${{ github.repository_owner }}"
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2024-04-04 20:09:04 +00:00
- name: Login to GitHub Container Registry
2025-02-25 20:46:54 +00:00
uses: docker/login-action@v2
2024-04-04 20:09:04 +00:00
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
2025-02-25 19:56:29 +00:00
password: ${{ secrets.GITHUB_TOKEN }}
2024-04-04 20:09:04 +00:00
- name: Set up Docker Buildx
2025-02-25 20:46:54 +00:00
uses: docker/setup-buildx-action@v2
2024-04-04 20:09:04 +00:00
- name: Build and push
2025-02-25 20:46:54 +00:00
uses: docker/build-push-action@v5
2024-04-04 20:09:04 +00:00
with:
push: true
2025-02-25 20:46:54 +00:00
tags: ghcr.io/${{ github.repository }}:latest
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}