metadata/.github/workflows/ci.yml

35 lines
907 B
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
2024-04-04 20:09:04 +00:00
steps:
2025-02-25 21:06:38 +00:00
- name: Checkout repository
uses: actions/checkout@v4
- name: Create .npmrc
run: echo -e "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}\n@preservetube:registry=https://npm.pkg.github.com/" >$HOME/.npmrc
2025-02-25 20:46:54 +00:00
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:57:13 +00:00
tags: ghcr.io/${{ github.repository }}:latest