Skip to content

Commit

Permalink
Run CI for Go
Browse files Browse the repository at this point in the history
  • Loading branch information
catatsuy committed Feb 10, 2024
1 parent 3997e05 commit 444febd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
21 changes: 10 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
name: CI

on: [push]
on:
push:
paths:
- 'webapp/golang/**'
- 'webapp/ruby/**'
- 'webapp/php/**'
- 'benchmarker/**'
- 'Makefile'

jobs:
build-and-test:
Expand Down Expand Up @@ -34,17 +41,9 @@ jobs:
run: make init

- name: Check for changes in golang directory
id: check-changes
if: contains(github.event.pull_request.changed_files, 'webapp/golang/')
run: |
if git diff --name-only ${{ github.sha }} | grep 'golang/'; then
echo "Changes detected in golang directory"
echo "::set-output name=go_changes_detected::true"
fi
- name: Update compose.yml if changes are detected
if: steps.check-changes.outputs.go_changes_detected == 'true'
run: |
sed -i 's|build: ruby/|build: golang/|' ./webapp/compose.yml
sed -i 's|build: ruby/|build: golang/|' ./webapp/docker-compose.yml
- name: Start the server
run: |
Expand Down
2 changes: 1 addition & 1 deletion webapp/golang/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.21
FROM golang:1.22

RUN mkdir -p /home/webapp
WORKDIR /home/webapp
Expand Down

0 comments on commit 444febd

Please sign in to comment.