Skip to content

docs: improve readability of the README file #123

docs: improve readability of the README file

docs: improve readability of the README file #123

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
env:
PORT: 80
jobs:
test:
name: Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '1.22'
- name: Run unit tests
run: go test ./...
# lint:
# name: Lint
# needs: [test]
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - name: Set up Go
# uses: actions/setup-go@v2
# with:
# go-version: '1.22'
# - name: Install golangci-lint
# run: |
# curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.42.1
# - name: Run linting
# run: golangci-lint run
format:
name: Format
# needs: [lint]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '1.22'
- name: Run go fmt
run: go fmt ./...
build:
needs: [test, format]
name: Build
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
outputs:
tag: ${{ steps.image-name.outputs.TAG }}
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GH_TOKEN }}
- name: Generate Image Name
id: image-name
run: |
TAG=$(echo ${{ github.sha }} | cut -c1-7)
IMAGE_URL=$(echo ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:$TAG | tr '[:upper:]' '[:lower:]')
echo "IMAGE_URL=$IMAGE_URL" >> $GITHUB_OUTPUT
echo "TAG=$TAG" >> $GITHUB_OUTPUT
- name: Build and push Docker Image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ steps.image-name.outputs.IMAGE_URL }}
deploy:
if: github.event_name == 'push'
needs: build
name: Deploy
uses: wajeht/docker-cd-deploy-workflow/.github/workflows/[email protected]
with:
app-path: apps/ip
tag: ${{ needs.build.outputs.tag }}
secrets:
GH_TOKEN: ${{ secrets.GH_TOKEN }}