Skip to content

PRを作成した際にビルドする #7

PRを作成した際にビルドする

PRを作成した際にビルドする #7

name: Build and Push Multiple Docker Images
on:
pull_request:
types: [opened, synchronize, reopened, closed]
jobs:
build-and-push:
runs-on: ubuntu-latest
if: |
github.event.pull_request.merged == true ||
github.event.action == 'opened' ||
github.event.action == 'synchronize' ||
github.event.action == 'reopened'
strategy:
matrix:
include:
- dockerfile: admin.k8s.Dockerfile
image_name: nutfes/group-manager-2-admin-view
vue_app_url: ''
vue_app_api_url: ''
imgur_id: ''
imgur_token: ''
- dockerfile: front.k8s.Dockerfile
image_name: nutfes/group-manager-2-user-front
vue_app_url: ${{ secrets.VUE_APP_URL }}

Check failure on line 27 in .github/workflows/image-push-stage.yml

View workflow run for this annotation

GitHub Actions / Build and Push Multiple Docker Images

Invalid workflow file

The workflow is not valid. .github/workflows/image-push-stage.yml (Line: 27, Col: 26): Unrecognized named-value: 'secrets'. Located at position 1 within expression: secrets.VUE_APP_URL .github/workflows/image-push-stage.yml (Line: 28, Col: 30): Unrecognized named-value: 'secrets'. Located at position 1 within expression: secrets.VUE_APP_API_URL
vue_app_api_url: ${{ secrets.VUE_APP_API_URL }}
imgur_id: ${{ secrets.NUXT_IMGUR_CLIENT_ID }}
imgur_token: ${{ secrets.NUXT_IMGUR_CLIENT_SECRET }}
- dockerfile: api.k8s.Dockerfile
image_name: nutfes/group-manager-2-api
vue_app_url: ${{ secrets.VUE_APP_URL }}
vue_app_api_url: ${{ secrets.VUE_APP_API_URL }}
imgur_id: ''
imgur_token: ''
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Log in to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
file: ${{ matrix.dockerfile }}
push: true
tags: ${{ matrix.image_name }}:latest
build-args: |
VUE_APP_URL=${{ matrix.vue_app_url }}
VUE_APP_API_URL=${{ matrix.vue_app_api_url }}
NUXT_IMGUR_CLIENT_ID=${{ matrix.imgur_id }}
NUXT_IMGUR_CLIENT_SECRET=${{ matrix.imgur_token }}