Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NO-ISSUE] ci/adapt publish server docker image #14

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
91dd619
feat: add debian Dockerfile + update reqwest
GuillaumeDecMeetsMore Jul 10, 2024
6f234f0
fix: re-enable default features
GuillaumeDecMeetsMore Jul 10, 2024
df1096a
ci: start adapting publish client lib
GuillaumeDecMeetsMore Jul 12, 2024
51ef183
ci: comment out server Docker release
GuillaumeDecMeetsMore Jul 16, 2024
2bbedd5
chore: rename client lib
GuillaumeDecMeetsMore Jul 16, 2024
15106e1
chore: reset version
GuillaumeDecMeetsMore Jul 16, 2024
5922448
ci: fix semver regex
GuillaumeDecMeetsMore Jul 16, 2024
9d270a2
ci: fix regex(2)
GuillaumeDecMeetsMore Jul 16, 2024
36c7c5b
ci: fix wrong revert
GuillaumeDecMeetsMore Jul 16, 2024
8e988e5
ci: test with same namespace as organization
GuillaumeDecMeetsMore Jul 16, 2024
a1e427b
ci: try to fix publish
GuillaumeDecMeetsMore Jul 16, 2024
67cd3a5
fix: use pnpm
GuillaumeDecMeetsMore Jul 16, 2024
88ff4f0
ci: avoid checking git for the moment
GuillaumeDecMeetsMore Jul 16, 2024
8376c33
ci: check with default name
GuillaumeDecMeetsMore Jul 16, 2024
7d928b7
ci: testing...
GuillaumeDecMeetsMore Jul 16, 2024
e3709ec
ci: test using a different name
GuillaumeDecMeetsMore Jul 16, 2024
252ca56
ci: try using same namespace but different repo name
GuillaumeDecMeetsMore Jul 16, 2024
843bc03
ci: re-enable docker build & publish
GuillaumeDecMeetsMore Jul 16, 2024
31b4394
Merge branch 'guillaume/feat/add-debian-slim-dockerfile' into guillau…
GuillaumeDecMeetsMore Jul 16, 2024
89769b5
ci: fix path for file + add platforms
GuillaumeDecMeetsMore Jul 16, 2024
c3ae23e
ci: try with by adding context path
GuillaumeDecMeetsMore Jul 16, 2024
d269190
Merge branch 'master' into guillaume/ci/adapt-publish-client-lib
GuillaumeDecMeetsMore Jul 16, 2024
d97b11b
Merge branch 'guillaume/ci/adapt-publish-client-lib' into guillaume/c…
GuillaumeDecMeetsMore Jul 16, 2024
c9d9b46
ci: only build for amd64 for now
GuillaumeDecMeetsMore Jul 16, 2024
66e4e76
ci: fix image name
GuillaumeDecMeetsMore Jul 16, 2024
3e4d0d9
Merge branch 'master' into guillaume/ci/adapt-publish-server-docker-i…
GuillaumeDecMeetsMore Jul 16, 2024
402b59d
ci: re-enable migrations' checks
GuillaumeDecMeetsMore Jul 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
117 changes: 62 additions & 55 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: Release

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

on:
push:
# Sequence of patterns matched against refs/tags
Expand All @@ -10,63 +14,66 @@ on:
- "v[0-9]+.[0-9]+.[0-9]+-?[a-zA-Z0-9]*"

jobs:
# docker-release:
# runs-on: ubuntu-latest
# services:
# postgres:
# image: postgres:13
# env:
# POSTGRES_PASSWORD: postgres
# POSTGRES_DB: nettuscheduler
# ports:
# - 5432:5432
# env:
# DATABASE_URL: postgresql://postgres:postgres@localhost/nettuscheduler
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# - name: Set version env
# run: |
# # v1.0.0 --> 1.0.0
# VERSION=${GITHUB_REF#refs/*/}
# echo "VERSION=${VERSION:1}" >> $GITHUB_ENV

# - uses: actions/cache@v4
# with:
# path: |
# ~/.cargo/bin/
# ~/.cargo/registry/index/
# ~/.cargo/registry/cache/
# ~/.cargo/git/db/
# scheduler/target/
# key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
docker-release:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
services:
postgres:
image: postgres:13
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: nettuscheduler
ports:
- 5432:5432
env:
DATABASE_URL: postgresql://postgres:postgres@localhost/nettuscheduler
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set version env
run: |
# v1.0.0 --> 1.0.0
VERSION=${GITHUB_REF#refs/*/}
echo "VERSION=${VERSION:1}" >> $GITHUB_ENV

# - name: Set up QEMU
# uses: docker/setup-qemu-action@v3
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v3
# - name: Login to DockerHub
# uses: docker/login-action@v3
# with:
# registry: ghcr.io
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
scheduler/target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

# - name: Run migrations
# run: |
# cd scheduler
# cargo install sqlx-cli --no-default-features --features postgres || true
# (cd crates/infra && sqlx migrate run)
- name: Run migrations
run: |
cd scheduler
cargo install sqlx-cli --no-default-features --features postgres || true
(cd crates/infra && sqlx migrate run)

# - name: Build and push
# uses: docker/build-push-action@v6
# with:
# context: ./scheduler
# push: true
# file: "{context}/debian.Dockerfile"
# tags: |
# fmeringdal/nettu-scheduler:latest
# fmeringdal/nettu-scheduler:${{ env.VERSION }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: ./scheduler
push: true
file: "./scheduler/debian.Dockerfile"
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }}

# We don't use the Rust client for now
# To re-enable later
Expand Down Expand Up @@ -206,7 +213,7 @@ jobs:

javascript-client-release:
runs-on: ubuntu-latest
# needs: docker-release
needs: docker-release
permissions:
contents: read
packages: write
Expand Down
Loading