Skip to content

Commit

Permalink
ci: improve workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
sgtoj committed Jul 8, 2023
1 parent 7ea24e9 commit d3eb816
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 42 deletions.
77 changes: 38 additions & 39 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,39 +1,38 @@
FROM mcr.microsoft.com/vscode/devcontainers/base:1-focal

# Install AWS CLI
RUN apt-get update && \
apt-get install -y unzip python3-pip && \
pip3 install --no-cache-dir --upgrade awscli && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Install Node.js and npm
ENV NODE_VERSION=18.x
RUN curl -sL https://deb.nodesource.com/setup_${NODE_VERSION} | bash - && \
apt-get install -y nodejs

# Install TypeScript
RUN npm install -g typescript

# Install Docker CLI
COPY --from=docker:dind /usr/local/bin/docker /usr/local/bin/

# Install Terraform
ENV TERRAFORM_VERSION=1.5.1
ENV TF_PLUGIN_CACHE_DIR=$HOME/.terraform.d/plugin-cache
RUN mkdir -p $TF_PLUGIN_CACHE_DIR
RUN SYSTEM_ARCH=$(dpkg --print-architecture) \
&& curl -OL https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_${SYSTEM_ARCH}.zip \
&& unzip terraform_${TERRAFORM_VERSION}_linux_${SYSTEM_ARCH}.zip \
&& mv terraform /usr/local/bin/ \
&& terraform version \
&& rm terraform_${TERRAFORM_VERSION}_linux_${SYSTEM_ARCH}.zip


# Verify that everything was installed correctly
RUN terraform --version \
&& aws --version \
&& node --version \
&& npm --version \
&& tsc --version \
&& docker --version
FROM mcr.microsoft.com/vscode/devcontainers/base:1-focal

# Install AWS CLI
RUN apt-get update && \
apt-get install -y unzip python3-pip && \
pip3 install --no-cache-dir --upgrade awscli && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Install Node.js and npm
ENV NODE_VERSION=18.x
RUN curl -sL https://deb.nodesource.com/setup_${NODE_VERSION} | bash - && \
apt-get install -y nodejs

# Install TypeScript
RUN npm install -g typescript

# Install Docker CLI
COPY --from=docker:dind /usr/local/bin/docker /usr/local/bin/

# Install Terraform
ENV TERRAFORM_VERSION=1.5.1
ENV TF_PLUGIN_CACHE_DIR=$HOME/.terraform.d/plugin-cache
RUN mkdir -p $TF_PLUGIN_CACHE_DIR
RUN SYSTEM_ARCH=$(dpkg --print-architecture) \
&& curl -OL https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_${SYSTEM_ARCH}.zip \
&& unzip terraform_${TERRAFORM_VERSION}_linux_${SYSTEM_ARCH}.zip \
&& mv terraform /usr/local/bin/ \
&& terraform version \
&& rm terraform_${TERRAFORM_VERSION}_linux_${SYSTEM_ARCH}.zip

# Verify that everything was installed correctly
RUN terraform --version \
&& aws --version \
&& node --version \
&& npm --version \
&& tsc --version \
&& docker --version
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8

[Dockerfile,Dockerfile.*]
[{Dockerfile,Dockerfile.*}]
indent_size = 4
tab_width = 4

Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ jobs:
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
default_bump: minor
custom_release_rules: bug:patch:Fixes,chore:patch:Chores,docs:patch:Documentation,feat:minor:Features,refactor:minor:Refactors,test:patch:Tests,ci:patch:CI
- name: Create Release
uses: ncipollo/release-action@v1
uses: ncipollo/release-action@v1.12.0
with:
tag: ${{ steps.tag_version.outputs.new_tag }}
name: Release ${{ steps.tag_version.outputs.new_tag }}
name: ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.tag_version.outputs.changelog }}
26 changes: 26 additions & 0 deletions .github/workflows/semantic-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: semantic-check
on:
pull_request_target:
types:
- opened
- edited
- synchronize

permissions:
contents: read
pull-requests: read

jobs:
main:
name: Semantic Commit Message Check
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- uses: amannn/action-semantic-pull-request@v5.2.0
name: Check PR for Semantic Commit Message
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
requireScope: false
validateSingleCommit: true

0 comments on commit d3eb816

Please sign in to comment.