Giter Club home page Giter Club logo

yandex-storage-website-action's Introduction

Yandex Object Storage static website hosting GitHub action

Hosting setup

Configuration

Key Value Default Required
access-key-id The ID of the key that you received when generating the static key.
secret-access-key The secret key that you received when generating the static key.
bucket Bucket name.
working-directory Specify the working directory of where to run the action. The working directory is the directory in which the action is running and is used as the base directory for any relative paths used by the action. root project directory
include Include patterns for files. Collects all files in the working-directory by default. ["**/*"]
exclude Exclude patterns for files. []
clear Clear bucket before deploy. false

Examples

Hosting full build directory

name: Deploy

on:
    push:
        branches: [main]

jobs:
    deploy:
        runs-on: ubuntu-latest
        steps:
            - uses: actions/checkout@v3
            - uses: actions/setup-node@v3
              with:
                  node-version: 16
            # Build
            - run: npm ci
            - run: npm run build
            # Deploy
            - uses: nekitcorp/yandex-storage-website-action@v2
              with:
                  access-key-id: ${{ secrets.ACCESS_KEY_ID }}
                  secret-access-key: ${{ secrets.SECRET_ACCESS_KEY }}
                  bucket: ${{ secrets.BUCKET }}
                  working-directory: build
                  clear: true

Exclude some files

name: Deploy

on:
    push:
        branches: [main]

jobs:
    deploy:
        runs-on: ubuntu-latest
        steps:
            - uses: actions/checkout@v3
            - uses: actions/setup-node@v3
              with:
                  node-version: 16
            # Build
            - run: npm ci
            - run: npm run build
            # Deploy
            - uses: nekitcorp/yandex-storage-website-action@v2
              with:
                  access-key-id: ${{ secrets.ACCESS_KEY_ID }}
                  secret-access-key: ${{ secrets.SECRET_ACCESS_KEY }}
                  bucket: ${{ secrets.BUCKET }}
                  working-directory: build
                  include: |
                      **/*
                  exclude: |
                      **/*.d.ts
                      package.json
                      README.md

yandex-storage-website-action's People

Contributors

dependabot[bot] avatar nekitcorp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

powerdot mrmeison

yandex-storage-website-action's Issues

path is gone in v2

Hello,

I used to deploy my web app to a bucket via path: "./build". it took all my files in the build directory and deployed them to the root of the bucket.

But path is gone in v2 and now I have to use include. If I use include: build/* it deploys build directory to the root of the bucket.

How can I deploy all files from a directory in my project to the root of the bucket, but without deploying the directory itself to the bucket?
In v1 this code did the trick, but not sure how to achieve the same behaviour in v2?
https://github.com/NekitCorp/yandex-storage-website-action/blob/v1/src/index.ts#L60

Upload operation failed with "Error: Expected params.ContentType to be a string" where content type is defined

Hi there,
I have faced with really strange behaviour of the action.

I have tried to upload my Hugo web site using the action and fails with weird reason given on the screenshot.

What are interesting here:

  • this is not first Hugo web site I am trying to upload using the action. On other web sites - everything is fine
  • according to the log message above the error message - content type is set and it's fine
  • if problematic file will be removed - upload will fail on another file. I have tried to remove 3 files that way - and on each run afterward the action failed with same reason for another file

Снимок экрана 2022-11-03 в 08 56 12

Can you help me beat the problem, please?

P.S. The action is pretty outdated. GitHub Runners warn about node.js 12 usage where 16 is recommended.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.