Created
April 7, 2022 17:42
-
-
Save kiquetal/8531f99f1297b0464b5e12598fb15549 to your computer and use it in GitHub Desktop.
initial ci/cd for aws.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This file is a template, and might need editing before it works on your project. | |
# To contribute improvements to CI/CD templates, please follow the Development guide at: | |
# https://docs.gitlab.com/ee/development/cicd/templates.html | |
# This specific template is located at: | |
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Getting-Started.gitlab-ci.yml | |
# This is a sample GitLab CI/CD configuration file that should run without any modifications. | |
# It demonstrates a basic 3 stage CI/CD pipeline. Instead of real tests or scripts, | |
# it uses echo commands to simulate the pipeline execution. | |
# | |
# A pipeline is composed of independent jobs that run scripts, grouped into stages. | |
# Stages run in sequential order, but jobs within stages run in parallel. | |
# | |
# For more information, see: https://docs.gitlab.com/ee/ci/yaml/index.html#stages | |
image: alpine:3.14.2 | |
default: | |
before_script: | |
- apk add nodejs | |
- apk add npm | |
- apk add python3 | |
- apk add py3-pip | |
- npm install | |
cache: | |
key: ${CI_COMMIT_REF_SLUG} | |
paths: | |
- node_modules/ | |
pages: | |
variables: | |
NEXT_PUBLIC_API_URL: $NEXT_PUBLIC_API_URL | |
script: | |
- npm run build | |
- npm run export | |
- mv out/* public | |
- echo $NEXT_PUBLIC_API_URL | |
artifacts: | |
paths: | |
- public | |
only: | |
- main | |
artifact_download: | |
before_script: | |
- apk add curl | |
- apk add unzip | |
- apk add py3-pip | |
- pip3 install awscli --upgrade | |
script: | |
- 'curl --location --output artifacts.zip --header "JOB-TOKEN: $CI_JOB_TOKEN" "https://gitlab.edge.com.py/api/v4/projects/$CI_PROJECT_ID/jobs/artifacts/main/download?job=pages"' | |
- unzip -B artifacts.zip | |
when: manua |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment