Skip to content

Commit

Permalink
added docker
Browse files Browse the repository at this point in the history
  • Loading branch information
emilpriver committed Dec 26, 2023
1 parent 5557839 commit f9bdbea
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 20 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@

name: Docker

on:
pull_request:
push:
branches:
- '*'
tags:
- '*'

env:
CARGO_TERM_COLOR: always

jobs:
test:
strategy:
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install docker for macos
if: startsWith(matrix.os, 'macos-')
uses: douglascamata/setup-docker-macos-action@v1-alpha
- name: Databases
run: docker compose up -d
- name: Run tests
run: cargo test --verbose
build-and-releas:
name: build and release docker
needs: [test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build
run: docker build -t ghcr.io/${{ github.repository }}/geni:${{ github.ref_name }} .
- name: Push
if: startsWith(github.ref, 'refs/tags/')
run: docker push ghcr.io/${{ github.repository }}/geni:${{ github.ref_name }}
22 changes: 2 additions & 20 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install docker for macos
if: startsWith(matrix.os, 'macos-')
uses: douglascamata/setup-docker-macos-action@v1-alpha
Expand Down Expand Up @@ -74,7 +74,7 @@ jobs:
env: ${{ matrix.env }}
steps:
- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v4
- name: Install toolchains
run: rustup update
- name: Setup environment
Expand All @@ -96,21 +96,3 @@ jobs:
files: 'geni*'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
release-docker:
name: build and release docker
needs: [build-binary]
runs-on: ubuntu-latest
steps:
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
push: true
tags: ghcr.io/${{ github.repository }}/geni:latest

0 comments on commit f9bdbea

Please sign in to comment.