Skip to content

Docker setup

Docker setup #12

Workflow file for this run

name: Build and Push Docker Image
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
define-vars:
name: Define variables
runs-on: ubuntu-latest
outputs:
docker_tag: ${{ steps.create-docker-tag.outputs.docker_tag }}
steps:
- uses: actions/checkout@v2
- id: create-docker-tag
run: echo "::set-output name=docker_tag::$(git rev-parse --abbrev-ref ${{ github.head_ref || github.ref || 'HEAD' }} | sed 's/[^a-z0-9_-]/__/gi')"
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ secrets.DOCKER_USERNAME }}/drips-app
- uses: actions/setup-node@v4
with:
node-version: 22
- name: Install deps. Unnecessary but cannot download the schema without this. Got a better idea? Open a PR!
run: npm ci
- name: Download GQL schema from main
run: GQL_URL=https://drips-multichain-api.up.railway.app/ GQL_ACCESS_TOKEN=${{ secrets.GQL_ACCESS_TOKEN }} ./scripts/generate-schema.sh
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: .
file: ./Dockerfile
context: .

Check failure on line 55 in .github/workflows/publish-docker.yml

View workflow run for this annotation

GitHub Actions / Build and Push Docker Image

Invalid workflow file

The workflow is not valid. .github/workflows/publish-docker.yml (Line: 55, Col: 11): 'context' is already defined
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}