Merge pull request #14 from akorchyn/dependabot/cargo/h2-0.3.26 #69
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and push Docker images | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: | |
- target: graphql | |
context: . | |
- target: chainlink-collector | |
context: . | |
- target: coingecko-collector | |
context: . | |
- target: cryptocompare-collector | |
context: . | |
- target: gateio-collector | |
context: . | |
- target: aggregator | |
context: . | |
- target: user-service | |
context: . | |
- target: notification-service | |
context: . | |
- target: telegram-notification | |
context: . | |
- target: frontend | |
context: ./frontend | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to GitHub Packages | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set DOCKERFILE environment variable | |
run: echo "DOCKERFILE=${{ matrix.context }}/Dockerfile" >> $GITHUB_ENV | |
- name: Build and push image (push) | |
if: github.event_name == 'push' | |
uses: docker/build-push-action@v4 | |
with: | |
context: ${{ matrix.context }} | |
file: ${{ env.DOCKERFILE }} | |
target: ${{ matrix.target }} | |
push: true | |
tags: ghcr.io/${{ github.repository_owner }}/${{ matrix.target }}:${{ github.sha }} | |
- name: Build image (pull request) | |
if: github.event_name == 'pull_request' | |
uses: docker/build-push-action@v4 | |
with: | |
context: ${{ matrix.context }} | |
file: ${{ env.DOCKERFILE }} | |
target: ${{ matrix.target }} |