mirror of
https://github.com/jikan-me/jikan-rest.git
synced 2025-02-20 11:23:35 +08:00
added github action to push container images
This commit is contained in:
parent
2ec635f47b
commit
bb7b59c244
5
.github/dependabot.yml
vendored
5
.github/dependabot.yml
vendored
@ -11,3 +11,8 @@ updates:
|
|||||||
interval: "daily"
|
interval: "daily"
|
||||||
allow:
|
allow:
|
||||||
- dependency-name: "jikan*"
|
- dependency-name: "jikan*"
|
||||||
|
- package-ecosystem: "github-actions"
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: "monthly"
|
||||||
|
|
||||||
|
103
.github/workflows/container-image-release.yml
vendored
Normal file
103
.github/workflows/container-image-release.yml
vendored
Normal file
@ -0,0 +1,103 @@
|
|||||||
|
name: Container Image Release
|
||||||
|
concurrency: production
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release-base-image:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
baseImagePhpVersion: ['8.0', '8.1']
|
||||||
|
name: Release base container image / PHP ${{ matrix.baseImagePhpVersion }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Set up qemu
|
||||||
|
uses: docker/setup-qemu-action@v2
|
||||||
|
|
||||||
|
- name: Set up docker buildx
|
||||||
|
uses: docker/setup-buildx-action@v2
|
||||||
|
with:
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
|
||||||
|
- name: Login to GitHub Container Registry
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Login to Docker Hub
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Build and push
|
||||||
|
uses: docker/build-push-action@v3
|
||||||
|
with:
|
||||||
|
push: true
|
||||||
|
context: ./docker/base_image/php-${{ matrix.baseImagePhpVersion }}
|
||||||
|
cache-from: type=registry,ref=ghcr.io/jikan-me/jikan-rest-php:${{ matrix.baseImagePhpVersion }}-${{ github.sha }}
|
||||||
|
cache-to: type=inline
|
||||||
|
build-args: |
|
||||||
|
GITHUB_PERSONAL_TOKEN=${{ secrests.GITHUB_TOKEN }}
|
||||||
|
tags: |
|
||||||
|
ghcr.io/jikan-me/jikan-rest-php:${{ matrix.baseImagePhpVersion }}
|
||||||
|
ghcr.io/jikan-me/jikan-rest-php:${{ matrix.baseImagePhpVersion }}-${{ github.sha }}
|
||||||
|
jikanme/jikan-rest-php:${{ matrix.baseImagePhpVersion }}
|
||||||
|
jikanme/jikan-rest-php:${{ matrix.baseImagePhpVersion }}-${{ github.sha }}
|
||||||
|
|
||||||
|
release-app-image:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
baseImagePhpVersion: [ '8.0', '8.1' ]
|
||||||
|
needs: Release base container image / PHP ${{ matrix.baseImagePhpVersion }}
|
||||||
|
name: Release App container image / PHP ${{ matrix.baseImagePhpVersion }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Set up qemu
|
||||||
|
uses: docker/setup-qemu-action@v2
|
||||||
|
|
||||||
|
- name: Set up docker buildx
|
||||||
|
uses: docker/setup-buildx-action@v2
|
||||||
|
with:
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
|
||||||
|
- name: Login to GitHub Container Registry
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Login to Docker Hub
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Build and push
|
||||||
|
uses: docker/build-push-action@v3
|
||||||
|
with:
|
||||||
|
push: true
|
||||||
|
context: .
|
||||||
|
cache-from: type=registry,ref=ghcr.io/jikan-me/jikan-rest:${{ matrix.baseImagePhpVersion }}-${{ github.sha }}
|
||||||
|
cache-to: type=inline
|
||||||
|
build-args: |
|
||||||
|
GITHUB_PERSONAL_TOKEN=${{ secrests.GITHUB_TOKEN }}
|
||||||
|
BASE_IMAGE_VERSION=${{ matrix.baseImagePhpVersion }}
|
||||||
|
tags: |
|
||||||
|
ghcr.io/jikan-me/jikan-rest:latest
|
||||||
|
ghcr.io/jikan-me/jikan-rest:${{ github.sha }}
|
||||||
|
jikanme/jikan-rest:latest
|
||||||
|
jikanme/jikan-rest:${{ github.sha }}
|
@ -1,5 +1,7 @@
|
|||||||
FROM jikanme/jikan-rest-php:8.1
|
ARG BASE_IMAGE_VERSION="8.1"
|
||||||
|
FROM jikanme/jikan-rest-php:${BASE_IMAGE_VERSION}
|
||||||
ARG GITHUB_PERSONAL_TOKEN
|
ARG GITHUB_PERSONAL_TOKEN
|
||||||
|
LABEL org.opencontainers.image.source=https://github.com/jikan-me/jikan-rest
|
||||||
RUN set -ex \
|
RUN set -ex \
|
||||||
&& apt-get update && apt-get install -y --no-install-recommends \
|
&& apt-get update && apt-get install -y --no-install-recommends \
|
||||||
openssl \
|
openssl \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user